How to show all underscore records from a table [Resolved]

Posted by Shweta_Pinky under Sql Server on 5/26/2013 | Points: 10 | Views : 1301 | Status : [Member] | Replies : 3
Show all underscore containing records from a table?




Responses

Posted by: Satyapriyanayak on: 5/26/2013 [Member] [MVP] Silver | Points: 50

Up
0
Down

Resolved
SELECT sname
FROM student
WHERE (sname LIKE '%|_%%' ESCAPE '|')

If this post helps you mark it as answer
Thanks

Shweta_Pinky, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Pandians on: 5/27/2013 [Member] [MVP] Silver | Points: 50

Up
0
Down

Resolved
You can also use
SELECT * FROM student WHERE sname LIKE '%[_]%'



Cheers
www.SQLServerbuddy.blogspot.com
iLink Multitech Solutions

Shweta_Pinky, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Learningtorise on: 5/27/2013 [Member] Starter | Points: 25

Up
0
Down
SatyaPriyanayak, can u explain query ?

What is the purpose of Escape '|' ?

http://hashtagakash.wordpress.com/

Shweta_Pinky, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response