72 조건에 부합하는 중고거래 댓글 조회하기
SELECT TITLE, B.BOARD_ID, REPLY_ID, R.WRITER_ID, R.CONTENTS, DATE_FORMAT(R.CREATED_DATE, '%Y-%m-%d') CREATED_DATE
FROM USED_GOODS_BOARD B JOIN USED_GOODS_REPLY R
ON B.BOARD_ID=R.BOARD_ID
WHERE B.CREATED_DATE LIKE '2022-10%'
ORDER BY CREATED_DATE, TITLE
73 입양 시각 구하기(2)
WITH RECURSIVE TIME AS (
SELECT 0 AS HOUR
UNION ALL
SELECT HOUR + 1
FROM TIME
WHERE HOUR < 23
)
SELECT T.HOUR AS HOUR, COUNT(O.ANIMAL_ID) AS COUNT
FROM TIME T LEFT JOIN ANIMAL_OUTS O ON T.HOUR=HOUR(O.DATETIME)
GROUP BY T.HOUR
ORDER BY T.HOUR
'AI 부트캠프 > SQL 코드카타' 카테고리의 다른 글
85 (0) | 2024.11.18 |
---|---|
67, 68, 69, 70, 71 (0) | 2024.10.31 |
66 (0) | 2024.10.30 |
65 (0) | 2024.10.29 |
60, 61, 62, 63, 64 (2) | 2024.10.24 |