Tuesday 5 March 2013

oracle

set operators:
    union
    union all
    intersect
    minus
------------------------------------------------------------------------------------------------------------------------------------guidelines:
    1.the expression in the select list must match in number and datatype
    2.duplicate rows are automatically eliminate expect in union all
    3.the output is stored in ascending order by default expect in union all.
------------------------------------------------------------------------------------------------------------------------------------
example for union:
    select name from balan union select sname from tb_1;
------------------------------------------------------------------------------------------------------------------------------------
example for union all
    select name from balan union all select sname from tb_1;
------------------------------------------------------------------------------------------------------------------------------------
example for intersect
    select name from balan intersect select sname from tb_1;
------------------------------------------------------------------------------------------------------------------------------------
example for minus
    select name from balan minus select sname from tb_1;
------------------------------------------------------------------------------------------------------------------------------------