Saturday, 8 October 2011

DML-select-Union and Union all:

nUsing union you can combine two or more select statements
nYou can use union to eliminate duplicates and union all to retain duplicates
Syntax:
SELECT column_name(s) FROM table_name1
UNION or UNION ALL
SELECT column_name(s) FROM table_name2
Query:
SELECT Empname FROM Emptbl1
UNION or UNION ALL
SELECT Empname FROM Emptbl2

No comments:

Post a Comment