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

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s