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

How to use "begin ... End" statement structures in ms sql server?

528


What is a with(nolock)?

581


What are sp_configure commands and set commands?

566


How do I perform an unattended install of sql server 2000?

604


How except clause is differs from not in clause?

538






Can two different columns be merged into single column? Show practically?

612


What are the aggregate and scalar functions?

527


How do I completely remove sql server instance?

570


Do you know what is similarity and difference between truncate and delete in sql?

579


What do you understand by SQL*Net?

617


What is the difference between SQL notification and SQL invalidation?

592


Tell me what do you understand by a view? What does the with check option clause for a view do?

647


How many null values we can have in a unique key field in sql server?

558


Explain timestamp datatype?

554


What function does a database engine serve in the sql server?

574