sql query to check 's
-
Friday, February 01, 2013 3:06 PM
hi
i have name like david's i need to check this in where clause or with like
how to do it in sql
All Replies
-
Friday, February 01, 2013 3:12 PM
DECLARE @tab TABLE(NAME VARCHAR(10)) INSERT INTO @tab SELECT 'abc''s' UNION ALL SELECT 'abcdef''s' UNION ALL SELECT 'lmn''s' UNION ALL SELECT 'pqr''s' SELECT * FROM @tab SELECT * FROM @tab WHERE NAME LIKE 'abc''s'
Narsimha
-
Friday, February 01, 2013 3:12 PM
You just double up the single quote:
Declare @tvTable Table ( DataCol varchar(10) ) Insert @tvTable Values ('blip'), ('blop'), ('flip''s'), ('flop''s') Select * From @tvTable Where DataCol Like '%''%'
- Proposed As Answer by Naomi NMicrosoft Community Contributor, Moderator Friday, February 01, 2013 9:50 PM
- Marked As Answer by Kalman TothMicrosoft Community Contributor, Moderator Sunday, February 10, 2013 10:11 AM
-
Friday, February 01, 2013 3:13 PM
itas not like that
its like abc's product,
abced's product
something liek this
-
Friday, February 01, 2013 3:13 PM
select * from person where lastname = 'david''s' select * from person where lastname like '%''%'
-
Friday, February 01, 2013 3:21 PM
itas not like that
its like abc's product,
abced's product
something liek this
Try
SELECT * FROM @tab WHERE NAME LIKE ('abc''s%')Narsimha
-
Friday, February 01, 2013 7:20 PM
SELECT * FROM yourtable WHERE yourcolumn LIKE '%''%';- Proposed As Answer by AccDba111 Friday, February 01, 2013 8:25 PM
-
Friday, February 01, 2013 8:19 PM
SELECT *
FROM <Your Table > where <Fields> LIKE '%Your Desired O/P%'

