SELECT 결과의 여러 ROW를 한 줄로 출력할 때 사용

 

 

사용 예)

SELECT GROUP_CONCAT(AA.PRODUCT_NAME SEPARATOR ',') AS PRODUCT_NAME
FROM TBL_PRODUCT AA
WHERE AA.MEMBER_ID = 'test'
ORDER BY AA.POST_SEQ DESC
LIMIT 0, 3

 

 

SELECT GROUP_CONCAT(DISTINCT AA.PRODUCT_NAME ORDER BY AA.POST_SEQ DESC SEPARATOR ',') AS RODUCT_NAME

FROM TBL_PRODUCT AA
WHERE AA.MEMBER_ID = 'test'
ORDER BY AA.POST_SEQ DESC
LIMIT 0, 3

 

 

참고 : MySql reference

 

+ Recent posts