본문 바로가기
Developer/DB

[DB] CUBRID GROUP_CONCAT을 ORACLE로 전환

by 순수한소년 2022. 7. 29.
728x90
반응형

[CUBRID]

SELECT

(select IFNULL(GROUP_CONCAT(file_id SEPARATOR '|'), null) from ntb_file where parent_id = a.post_id) as file_content

FROM
ntb_post a
WHERE
BOARD_ID =11

 

[ORACLE]

SELECT

(SELECT NULLIF(LISTAGG (ATCH_FILE_ID, '|') WITHIN GROUP (ORDER BY ATCH_FILE_ID),'') FROM TN_FILEDETAIL WHERE ATCH_FILE_ID = a.ATCH_FILE_ID) as file_content

FROM
ntb_post a
WHERE
BOARD_ID =11

728x90
반응형