Hi, I do not understand why following code does not work?
SELECT [column1], [column2]
FROM table where Column1 <> ('%TEST%')
ORDER BY 1
I want to have all rows where Column1 does not contain TEST
Thanks
Hi, I do not understand why following code does not work?
SELECT [column1], [column2]
FROM table where Column1 <> ('%TEST%')
ORDER BY 1
I want to have all rows where Column1 does not contain TEST
Thanks
% is a wildcard expression, which is probably the reason why; I think you may, if you want a literal %, wrap it in square braces [%], but I actually forget if that is the answer, and apologize if it isn't.
If you want to use it as where the column doesn't have the text test in it, then you do:
where column1 not like '%Test%'
Use LIKE operator with Wildcards %:
SELECT [column1], [column2]
FROM table
WHERE Column1 NOT LIKE ('%TEST%')
ORDER BY 1
try
SELECT [column1], [column2]
FROM table where Column1 NOT LIKE '%TEST%'
ORDER BY 1