Thursday, June 22, 2006

SQL: IN and EXISTS

I read an interesting article at AskTom where he described the difference between IN and EXISTS.
My summary is to use IN when the subquery returns few rows and to use EXISTS when the subquery returns many rows.

Also, never use NOT IN, only NOT EXISTS - but that is my personal opinion.

0 Comments:

Post a Comment

<< Home