i have following fields such as
Sno Location Owned Leased
1 chennai ltd gro
2 delhi Lcc nestle
3 coimbatore Lco musicword
4 Mumbai Aircell Vacant
in that i want the output Sno 3 and 4 datas only.
for that in sql through query how to use not in.
i remember we use not in query through sql how to do for my above question please send the query.
Rgds,
Narasiman P
Loading
Jignesh TrivediPosted Jul 5, 2012, 6:52 AM
Agree with Muralidharan Dheenadhayalan for "not in" SQL server,
However "Not IN" Decrease Performance of Query
suggest to use "NOT EXISTS".
hope this will help.
Satyapriya NayakPosted Jul 5, 2012, 4:31 AM
You can do it in another way also
SELECT * FROM test WHERE (sno = 3) OR (sno = 4)
Thanks
Kunal VaishyaPosted Jul 5, 2012, 4:16 AM
tell us in details so we can help you
Posted Jul 5, 2012, 4:15 AM
select * from table1 where sno not in (1,2).