Quantcast
Channel: ฟอรัม Getting started with SQL Server
Viewing all articles
Browse latest Browse all 8428

negation operator with OR condition

$
0
0

Select * from tblPerson
where  (City != 'Chicago' OR City != 'London')

This query should not give the list of cities with Chicago or London names, but it is giving me all the list. I want to know what is wrong with this query and how to fix it.  Also, can we write in this in other way. Please let me know the answer.

Select * from tblPerson

where  City != 'Chicago'  OR  City <> 'London'



Viewing all articles
Browse latest Browse all 8428

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>