SQL Concat Rows if duplicate ID


Is there a way to concat rows if there are duplicate IDs?



For example



If I were to GROUP BY ROOM_ID I would lose the information in Line 2. So is there a way to get the following results:



Thanks



If you have only a handful of lines, then conditional aggregation might be the easiest method:



Note that this does not generalize very well, but it works quite effectively for two or three addresses.



You can do something similar with left join:






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

The Dalles, Oregon

眉山市

清晰法令