How to treat ' in Vertica

Moderator: NorbertKrupa

Post Reply
xlstime
Newbie
Newbie
Posts: 1
Joined: Thu Jan 15, 2015 9:05 am

How to treat ' in Vertica

Post by xlstime » Tue Jan 27, 2015 8:39 am

Hi Guys,

Please help me, how to treat ' in vertica in clause

in Mysql i use \ to manage or control ' please suggest

for example in mysql

SELECT 'xlstime\'s';

please suggest in Vertica

User avatar
JimKnicely
Site Admin
Site Admin
Posts: 1825
Joined: Sat Jan 21, 2012 4:58 am
Contact:

Re: How to treat ' in Vertica

Post by JimKnicely » Tue Jan 27, 2015 2:38 pm

Hi,

The easiest way to deal with an apostrophe "'" in text is to simply use double apostrophes "''".

Example:

Single apostrophe:

Code: Select all

dbadmin=> SELECT 'xlstime\'s';
dbadmin'>
Double apostrophes:

Code: Select all

dbadmin=> SELECT 'xlstime\''s';
  ?column?
------------
 xlstime\'s
(1 row)
 
Jim Knicely

Image

Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.

Post Reply

Return to “New to Vertica”