i have this code
SELECT DISTINCT idx_campus_bookinfo,c.userid as Buyer,bookname,book_explain,writedate
FROM campus_bookinfo cb
LEFT JOIN user_books ub ON idx_campus_bookinfo = id_product
LEFT JOIN customer c ON ub.id_customer = c.id_customer
where cb.idx_campus = 1 and cb.idxuser = 29 ORDER BY writedate DESC
which give an output of
My Question is how can i make the buyer column to be delimited by comma which has the same book.
Use the GROUP_CONCAT function, but it means having to replace DISTINCT with a GROUP BY:
Yes, you can: