3. Union All
I do not understand what the 'GROUP BY 1' at the end means. I recall group by from the 'learn sql' but I fail to see what it means here. Could one explain?. Thank You.
SELECT id, AVG(a.sale_price) FROM ( SELECT id, sale_price FROM order_items UNION ALL SELECT id, sale_price FROM order_items_historic) as a GROUP BY 1;