What is the difference between in and exists.
Ex: select * from emp where empno in(....) and
select * from emp where empno exists(....)

What is the difference between a Join and Union and Union
and UnionAll.

Answer Posted / manoj pandey

Check below links to know the reason with examples from my blog posts:

IN vs EXISTS vs JOIN: http://sqlwithmanoj.wordpress.com/2011/02/15/not-in-not-exists-joins-with-null-values/

UNION vs UNION ALL: http://sqlwithmanoj.wordpress.com/2010/12/30/why-union-all-is-faster-than-union/

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are types of scd? : sql server analysis services, ssas

540


How to assign null values to variables or columns?

551


Do you think BCNF is better than 2NF & 3NF? Why?

797


Where views are stored in sql server?

564


Define views.

596






How to receive returning result from a query?

586


Tell me what is the order in which the sql query is executed?

533


What is the usage of the sign function?

532


Create a dts package to produce a text file using the ‘update statistics’ command for the tables in a database with obsolete statistics.

536


What is sql server profiler trace data file?

589


How to find related tables in sql server?

501


Do you know what is recursion? Is it possible for a stored procedure to call itself or recursive stored procedure?

544


Explain user defined functions?

621


What is the use of @@spid?

576


Tell me what is the difference between locking and multi-versioning?

579