multiple search condition sql

2019-07-29 10:45发布

问题:

Is it possible to achieve something like this in sql?

ID!= {2,3}

where ID is a column. Or I have to use multiple OR statements?

回答1:

yes, not in:

ID not in (2,3)

You can read more here.



回答2:

You have to try With

ID NOT IN (2,3)

Or

ID <> 2 or ID <> 3


标签: sql search notin