Reputation: 479
I have a table tblEmpl
which has a column employeename
. In that employee name column I have a row with a value of John [Smith]
so I have a query to search the row but it is not selecting any row.
select * from tblEmpl
where EmployeeName like '%John [Smith]%'
Thanks
Upvotes: 1
Views: 2288
Reputation: 12271
Try this :
select * from tblEmpl where EmployeeName like '%John [[]Smith]%'
Upvotes: 2
Reputation: 9869
Try This
select * from tblEmpl where EmployeeName like '%John [[Smith]%'
Just replace [
to [[
.
Upvotes: 1
Reputation:
WHERE EmployeeName LIKE '%John \[Smith\]%' ESCAPE '\';
or
WHERE EmployeeName LIKE '%John [[]Smith]%';
Upvotes: 6