Posts

Showing posts with the label UNION- duplicate item becomes distinct

11 - UNION , UNION ALL

Image
  UNION  The UNION command combines the result set of two or more SELECT statements (only distinct values). UNION ALL The Union All extracts all the rows including the duplicates (repeated values) from both the queries. ORIGINAL GENERATED LIST       market_1                                                                               market_2                                    Make a final table from market_1 and market_2 which covers all products and  duplicate product becomes distinct select product from market_1 UNION select product from market_2; Make a final table from market_1 and market_2 which covers all products and  duplicate product stays duplicate se...