SQL Server using LIKE to find the firstname column for characters ""

I am trying to query a database table to return all records where the firstname column contains the characters " " .

For example Lars-Erik "Molle" .

I tried this:

 SELECT * FROM [bgtest].[dbo].[cuscon] WHERE firstname LIKE '%Lars-Erik%' 

and it returned the record, it was only me, making sure that I was doing it right, then I replace Lars-Erik with "" and, of course, he will not like '%""%' and will not return anything,

Any ideas I tried are CONTAINED and LIKED and cannot find a way to do this.

thanks

+5
source share
2 answers

It looks like you need a query:

 SELECT * FROM [bgtest].[dbo].[cuscon] WHERE firstname LIKE '%"%"%' 

Because %""% will only look for the next two characters " .

+10
source
 SELECT * FROM [bgtest].[dbo].[cuscon] WHERE firstname LIKE '%"%' 
0
source

All Articles