๐Ÿ’ซ ๋ฌธ์ œ



 

๐Ÿ’ซ CODE

SELECT BOOK_ID, DATE_FORMAT(PUBLISHED_DATE, '%Y-%m-%d') AS PUBLISHED_DATE
FROM BOOK
WHERE YEAR(PUBLISHED_DATE) = '2021' AND CATEGORY = '์ธ๋ฌธ'
ORDER BY PUBLISHED_DATE;

 

๐Ÿ’ซ ํ’€์ด ์กฐ๊ฑด

1. 2021๋…„์— ์ถœํŒ๋œ '์ธ๋ฌธ' ์นดํ…Œ๊ณ ๋ฆฌ์ธ ๊ฒฝ์šฐ
2. ๋„์„œ ID(BOOK_ID), ์ถœํŒ์ผ (PUBLISHED_DATE)์„ ์ถœ๋ ฅ
3. ์ถœํŒ์ผ ๊ธฐ์ค€ ์˜ค๋ฆ„์ฐจ์ˆœ ์ •๋ ฌ

 

๐Ÿ’ซ ํ’€์ด

1. SELECT BOOK_ID, DATE_FORMAT(PUBLISHED_DATE, '%Y-%m-%d') AS PUBLISHED_DATE
  • ๋„์„œ ID(BOOK_ID), ์ถœํŒ์ผ (PUBLISHED_DATE)์„ ์ถœ๋ ฅ
  • DATE_FORMAT(PUBLISHED_DATE, '%Y-%m-%d') : ์ถœํŒ์ผ (PUBLISHED_DATE) ๋…„-์›”-์ผ ์œผ๋กœ ์ถœ๋ ฅ๋˜๋„๋ก
2. WHERE YEAR(PUBLISHED_DATE) = '2021' AND CATEGORY = '์ธ๋ฌธ'
  • 2021๋…„์— ์ถœํŒ๋œ '์ธ๋ฌธ' ์นดํ…Œ๊ณ ๋ฆฌ์ธ ๊ฒฝ์šฐ
3. ORDER BY PUBLISHED_DATE
  • ์ถœํŒ์ผ ๊ธฐ์ค€ ์˜ค๋ฆ„์ฐจ์ˆœ ์ •๋ ฌ

By Dozzing

๋‹ต๊ธ€ ๋‚จ๊ธฐ๊ธฐ

์ด๋ฉ”์ผ ์ฃผ์†Œ๋Š” ๊ณต๊ฐœ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ํ•„์ˆ˜ ํ•„๋“œ๋Š” *๋กœ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค