how to fetch a record having quotes using sql

Hi All,

           How to fetch a record from a column having a value like Jack's david.when i try to fetch this value within single quotes like 'jack's david' it throws unclosed quotation mark.How to use escape sequence for singles quotes



Thanks,

R.karthik

Solution

You can escape single quotes by adding a single quote. (I know it sounds weird).

SELECT * FROM TABLE WHERE VALUE LIKE 'Jack''s David'

Will result in Jack's David

Solution

Joey Moree wrote:

You can escape single quotes by adding a single quote. (I know it sounds weird).

SELECT * FROM TABLE WHERE VALUE LIKE 'Jack''s David'

Will result in Jack's David

Hi Joey,

           Thanks for the Solution