Sonra arasında bir bağlantı tablo ile 2 tablolar var.
USERS
+-------+---------+
| userID| Username|
+-------+---------+
| 1 | Nate |
| 2 | Nic |
| 3 | John |
+-------+---------+
SITES
+--------+---------+
| siteID | Site |
+--------+---------+
| 1 | art |
| 2 | com |
| 3 | web |
+--------+---------+
USER_SITES
+-------------+---------+---------+
| user_site_id| user_id | site_id |
+-------------+---------+---------+
| 1 | 1 | 1 |
| 2 | 1 | 2 |
| 3 | 1 | 3 |
| 4 | 2 | 2 |
| 5 | 2 | 3 |
+-------------+---------+---------+
Ben böyle çıktısı bir sorgu yapmak istiyorum
USERS
+---------+----------------+
| username| sites |
+---------+----------------+
| Nate | art, com, web |
| Nic | com, web |
+---------+----------------+
Can that be done easily with 1 query? I would like to be able to do that in MySQL, and POSTgreSQL - but I'll take whatever I can get!! Thanks