I’m using this simple SQL query to retrieve data from two tables in my MySQL database:
SELECT customer_id, domain_name
FROM customers_orders
INNER JOIN orders ON order_id = sub_id
The result is similar to this:
1114 somedomain.com
1115 anotherdomain.net
1116 domain1.org
1116 domain2.com
How do I tell it to give me an output that is rather similar to:
1114 somedomain.com
1115 anotherdomain.net
1116 domain1.org, domain2.com
So as to avoid having two lines with the same customer_id… I wonder if it is even possible with SQL? I’m a beginner in SQL and I would very much appreciate your help on this.
Thanks a lot!
Try somethin like this