tags:

views:

39

answers:

2
+1  A: 

These two queries should, to my knowledge, achieve the same results (since the query checks for the same data - only the second one does it in a more elegant manner maybe).

Pawel J. Wal
Thanks Bro..... :D
Shahmir Javaid
Any body can Confirm 100%... sry Pawel need to be sure, maybe is not good when this thing is released. xD
Shahmir Javaid
+3  A: 

I haven't tested it, but they are most likely not equivalent. The NOT EXISTS form would make sense if used with a correlated subquery. But your subquery doesn't contain any reference to the outer query, so probably the second form won't delete any rows at all.

Also, presence of NULLs in the table may make these two forms act very differently.

Marek Rocki
Thanks. Is there a way around it. Could i use another query that will solve my NOT IN problem?
Shahmir Javaid
Could you post an example of the correlated query. It would be appreciated :D
Shahmir Javaid