Reputation: 83
Hi I am trying to find all strings in my database that have a format as folowed sometext [sometext] sometext. I tried to do it like this:
SELECT AlbumName
FROM album
WHERE AlbumName RLIKE '.*[.*].*';
The problem I think I have that RLIKE
takes [.*] as [a-z]
and I get back everything.
Upvotes: 2
Views: 451
Reputation: 5442
You should escape
the character [
and ]
SELECT AlbumName
FROM album
WHERE AlbumName RLIKE '.*\\[.*\\].*';
Upvotes: 1