Have 2 tables with a linking table between then.
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 |
+-------------+---------+---------+
I want to do one query that will output like this
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