[ํ๋ก๊ทธ๋๋จธ์ค] ์คํ๋ผ์ธ/์จ๋ผ์ธ ํ๋งค ๋ฐ์ดํฐ ํตํฉํ๊ธฐ | ์ค๋ผํด
ยท
๐ Coding Test/SQL
๋ฌธ์ ์คํ๋ผ์ธ/์จ๋ผ์ธ ํ๋งค ๋ฐ์ดํฐ ํตํฉํ๊ธฐํ์ดSELECT TO_CHAR(SALES_DATE, 'YYYY-MM-DD') SALES_DATE, PRODUCT_ID, USER_ID, SALES_AMOUNTFROM ( SELECT SALES_DATE, PRODUCT_ID, USER_ID, SALES_AMOUNT FROM ONLINE_SALE UNION SELECT SALES_DATE, PRODUCT_ID, NULL, SALES_AMOUNT FROM OFFLINE_SALE)WHERE TO_CHAR(SALES_DATE, 'YYYY-MM-DD') LIKE '2022-03%'ORDER BY 1, 2, 3;UNION์ ์ฌ์ฉํ์ฌ ํ์ดํ์ต๋๋ค.UNION์ ์ค๋ณต๋ ๋ฐ์ดํฐ๋ฅผ ์ ๊ฑฐํ๊ณ , UNION ALL..