Returning unique �cate_id's as a string separated by the comma(,) for each group of 'pub_id' from the book_mast table:
Publisher id
GROUP_CONCAT(DISTINCT cate_id)
P001
CA002,CA004
P002
CA003
P003
CA001,CA003
P004
CA002,CA005
P005
CA001,CA004
P006
CA001,CA005
P007
CA002,CA005
P008
CA004,CA005