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
How to verify a user name with sqlcmd tool?
what is a join and explain different types of joins? : Sql server database administration
What are policy management terms?
Write a SQL queries on Self Join and Inner Join.
what is the sql equivaent of the dataset relation object ?
How do you drop an index?
how to restart sql server in single user mode? How to start sql server in minimal configuration mode? : Sql server database administration
In what three ways is the return statement used in a stored procedure?
What objects does the fn_my_permissions function reports on? : sql server security
Why are sql functions used?
What is equi join with example?
Why is sql server log file full?
What stored by the msdb?
Call by value and call by reference in procedure and function, with NOCOPY.
How to list all triggers in the database with sys.triggers in ms sql server?