Closed ji-0630 closed 1 year ago
SELECT concat("/home/grep/src/", b.BOARD_ID , "/", f.FILE_ID, f.FILE_NAME, f.FILE_EXT) as "FILE_PATH"
from USED_GOODS_BOARD b inner join USED_GOODS_FILE f
on b.BOARD_ID = f.BOARD_ID
WHERE VIEWS = (SELECT MAX(VIEWS) FROM USED_GOODS_BOARD)
order by f.FILE_ID desc
*concat(): 글자 이어붙이는 함수
SELECT concat("/home/grep/src/", f.BOARD_ID, "/", FILE_ID, FILE_NAME, FILE_EXT) as "FILE_PATH"
from USED_GOODS_BOARD b join USED_GOODS_FILE f
on b.BOARD_ID = f.BOARD_ID
where b.BOARD_ID = (select BOARD_ID
from USED_GOODS_BOARD
order by VIEWS desc
limit 1)
order by FILE_ID desc
문제 설명