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 create and drop temp table in sql server?

771


You want to implement the many-to-many relationship while designing tables. How would you do it?

756


User wants only to display only pdf as export option in report manager. How to achieve this?

212


Explain different types of self contained sub query?

731


What new data source types were added in ssrs 2014?

130






How to drop an existing table with "drop table" statements in ms sql server?

729


What do I need to start working with sql studio? : sql server management studio

807


What happens when transaction log is full?

662


Do you know what is difference between stored procedure and user defined function?

803


What is data block and how to define data block size?

781


Explain linked server in sql?

867


can SSRS reports Cache results?

127


Which is the latest version of sql server and when it is released?

749


Mention the command used to rename the database.

725


How do I start sql server 2017?

702