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 / gopi muluka

IN:Returns true if the column matches to any value in a
subquery or a list.
Exists:Returns true if a subquery contains any row.

Generally EXISTS is faster than IN, because it stops
processing once it finds a row in resultset

Join : Returns only rows which are matching on Joining
Column

Union: Combines two or more resultsets with same number of
columns and displays it as a single resultset by
eliminating duplicate records

Union All: Combines two or more resultsets with same number
of columns,displays it as a single resultset including
duplicate records if any exists

Is This Answer Correct ?    16 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

tell me what is blocking and how would you troubleshoot it? : Sql server database administration

481


Why should we go for stored procedures? Why not direct queries?

572


What are system databases into sql server (2005/2008) : sql server database administration

563


How to change the system date and time from SQL Plus Terminal ?

676


How to turn off warning messages during php execution?

526






How to implement service broker?

521


Explain microsoft sql server functions?

538


What are different types of statement?

523


Does sql server use java?

514


What is cube dimension? : sql server analysis services, ssas

532


Is the log file is a part of file group?

548


What is acid mean in sql server?

570


Relational calculus is what type of language?

573


What do you understand by physical_only option in dbcc checkdb?

575


Explain candidate key, alternate key, and composite key?

587