...

View Full Version : Better way to eliminate rows in a query (without many OR)



maxpouliot
03-16-2007, 04:30 PM
This is my query :


SELECT cas.id,cas.noCas,cas.nomFictif,cas.prenom,cas.naissance FROM cas WHERE LEFT(noCas, 3)<'300' AND cas.id<>53 AND cas.id<>61 AND cas.id<>173 AND cas.id<>174 AND cas.id<>178 AND cas.id<>185 AND cas.id<>598 ORDER BY noCas

There must be a more efficeint way to find what i want than this :


AND cas.id<>53 AND cas.id<>61 AND cas.id<>173 AND cas.id<>174 AND cas.id<>178 AND cas.id<>185 AND cas.id<>598

Something like cas.id is not (list of values)

thanks for the help!

harsh789
03-16-2007, 04:41 PM
cas.id NOT IN (53,54,55....)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum