In the code below I am trying to find all of the values with '.123' or ']123' within them. Obviously I could use two LIKE statements like I have below, but ideally I'd prefer to use a single LIKE statment.
DECLARE @Table1 TABLE
Column1 VARCHAR(32) NOT NULL PRIMARY KEY
FROM @Table1 T
WHERE T.Column1 LIKE '%]123%'
OR T.Column1 LIKE '%.123%';
If we were dealing with any normal brackets instead of square brackets, we could use:
But this doesn't work with ']' due to it finishing off the choice functionality of the LIKE.
Does anyone have any suggestions on how I can include the ']' character within the LIKE '%%' functionality?