问题描述:

So here are the 2 queries I wrote

select Name from tblEmployees where Name not like '%[! -.]%[ .-]%[! -.]%' order by Name;

select Name from tblEmployees where Name not like '%[a-z]%[ .-]%[a-z]%' order by Name;

surprisingly both are having different results and even more surprising is the fact that 1st query shows more results than 2nd one..

any possible reasons why both queries not working in same way,

I don't think because the characters used in tblEmployees in Names have any other characters than a-z', '' (space) . and -.

I have run the queries in SOL server management.

网友答案:

It should be

[^ -.]

instead of

[! -.]
相关阅读:
Top