June 30, 2009 at 12:58 am
I have one varchar(string) column.
I want to query that column for character ' (char(39)).
like
select name from address where name like '%'%'
June 30, 2009 at 1:11 am
You just need to double up the single quotation mark:
select name from address where name like '%''%'
Mike
June 30, 2009 at 1:25 am
ok thanks .
I have also one more requirement.
I also want to search white spaces excluding a single space
like TAB,line brake,new line character.
June 30, 2009 at 1:36 am
Try one of these:
if searching for a tab
select name from address where name like '%' + CHAR(9) + '%'
or
select name from address where CHARINDEX(CHAR(9),name) > 0
Please also be aware that searches like these will table scan.
Mike
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply