Entry
How do I construct select statements where the string in the where clause has an apostrophe? Ex: SELECT * FROM customers WHERE name like 'Bob's%';
Sep 2nd, 2005 19:23
Rohit Kulkarni, Michael Vickers, Jackie Nguyen,
Try using double apostrophes. For instance, in T-SQL:
select idProfile from tblProfiles where strAddS1 like '%''%'
This select statement in one of my SQL Server DB's will return all IDs
in a particular table where there is an apostrophe somewhere in the
street address field.
So, for your particular select statement I would try:
SELECT * FROM customers WHERE name like 'Bob''s%'
Good luck.
Michael
--------------------------------
Two single quotes will work in case of PL/SQL too
-Rohit.
--------------------------------