HANA SQL- Union Vs Union All

light111Union Vs Union All 


Union operation combines two/more result tables that are created from the same  base table. But the database performs an implicit DISTINCT operation. Where as in UNION ALL its just combines two/more result tables [ duplicate occurs].

The below screen shot shows two results tables LT_CARRID1 & LT_CARRID2  which contains exact same records.

The UNION of these two result tables  gives back the combined distinct records where as the UNION ALL gives back the combined records.

1


 

Leave a Reply