Pages

Monday, February 13, 2012

JOIN vs IN vs EXISTS in sql

Difference between IN and EXISTS
  • IN will ignore null values where as EXISTS will considers null values as the result.
  • JOIN also, will consider null values.
Difference between IN and JOIN
  • IN does not consider duplicate values where as JOIN consider duplicates. (To avoid duplicate values, use DISTINCT)
  • EXISTS also does not consider duplicate values.

No comments:

Post a Comment