SELECT * FROM TableName WHERE CHARINDEX('_' ,SomeColumn ) > 0
--Here all column will come which is having underscore
SELECT * FROM TableName WHERE SomeColumn LIKE '%/_%' ESCAPE '/'
-- you can give some pattern using like as well we have used escape sequence in this way
SELECT * FROM TableName WHERE SomeColumn LIKE '%[_]%' ESCAPE '/'
-- you can give some pattern using like
This is one of the best SQL Server Interview Question.
If you have any queries or suggestions, please feel free to ask in comments section.
--Here all column will come which is having underscore
SELECT * FROM TableName WHERE SomeColumn LIKE '%/_%' ESCAPE '/'
-- you can give some pattern using like as well we have used escape sequence in this way
SELECT * FROM TableName WHERE SomeColumn LIKE '%[_]%' ESCAPE '/'
-- you can give some pattern using like
This is one of the best SQL Server Interview Question.
If you have any queries or suggestions, please feel free to ask in comments section.
Post a Comment
Please give your valuable feedback on this post. You can submit any ASP.NET article here. We will post that article in this website by your name.