1

I have a clarification table and a file uploads table where all the attachments with respect to the clarification is placed. I am using left join and getting the result like this.

clarificationid - 1 | attachment 1
clarificationid - 1 | attachment 2
clarificationid - 2 | no attachment

Is there any way to get result like

clarificationid - 1 | attachment 1,atttachment 2
clarificationid - 2 | no attachment
mrkrehman
  • 13
  • 4

1 Answers1

0

You can use GROUP_CONCAT,but be aware of that there is limit of characters in GROUP_CONCAT() but this can be increased for help follow this question

SELECT clarificationid ,
GROUP_CONCAT(attachment)
FROM 
`table`
GROUP BY clarificationid 
Community
  • 1
  • 1
M Khalid Junaid
  • 63,861
  • 10
  • 90
  • 118