In an SQL table I have following columns
id, title, content
And I would like to search text inside title or content having “[” or “]“.
What will be the SQL command to fetch such kind of data?
(edit: removed “efficient”)
(added)
As per “rsbarro”
I have tried and my findings are:
If I try for
SELECT * FROM MyTable WHERE Title LIKE '%[%'
returns 0 row.
If I try for
SELECT * FROM MyTable WHERE Title LIKE '%]%'
returns number of rows.
The examples above are failing for like matching because LIKE offers a single character match option with [].
To actually match a
[, you will need to embed it in a pair of bracketsReturns