November 15, 2007 at 1:41 am
Hi
In my table I have varchar column. Data contains ' mark like Johnson's,Arun's etc.
I want get all records that contains ' mark.
Pls help
Binu
November 15, 2007 at 2:01 am
SELECT * FROM MyTable
WHERE MyColumn LIKE '%''%'
John
November 15, 2007 at 2:57 am
hi
Thanks. I have to update the column with a value johnson's.
Also I want to select only records that contains ' mark.
binu
November 15, 2007 at 3:10 am
The trick is to double the single quote. So when inserting, instead of just one ('), you put in two (''). If you are selecting, the same rule applies. You asked for a query to locate all rows where a given field uses the single quote, hence the reason someone came back with LIKE '%''%'
K. Brian Kelley
@kbriankelley
November 15, 2007 at 3:45 am
Hi
I got the result. But I again I faced an issue. the column contains some values without ' mark. I need to extract these records also using a single query
binu
November 15, 2007 at 6:04 am
What is the criteria for retrieving the other rows? Write it out as a simple query and then cut out the WHERE part and add it to the first query after the WHERE part with an OR operator.
SELECT Column from Table WHERE column LIKE '%''%' OR column Operator Criteria
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply