SQL 고득점 kit(SELECT) - 오프라인/온라인 판매 데이터 통합하기
# 풀이 SELECT DATE_FORMAT(SALES_DATE, '%Y-%m-%d') SALES_DATE, PRODUCT_ID, USER_ID, SALES_AMOUNT FROM ONLINE_SALE WHERE SALES_DATE BETWEEN '2022-03-01' AND '2022-03-31' UNION ALL SELECT DATE_FORMAT(SALES_DATE, '%Y-%m-%d') SALES_DATE, PRODUCT_ID, NULL AS USER_ID, SALES_AMOUNT FROM OFFLINE_SALE WHERE SALES_DATE BETWEEN '2022-03-01' AND '2022-03-31' ORDER BY SALES_DATE, PRODUCT_ID, USER_ID; - 해설 3월에 팔..