concat group a SELECT in another SELECT
Simple question:
There are 2 tables:
Genre [name,song.id]
Songs [id,title,userID,status]
What is the query to get a result from
+----+-------------+----------------------+--------+--------+
| id | genre.name | song.title | userID | status |
+----+-------------+----------------------+--------+--------+
| 1 | tech | Feel it all | 1 | 1 |
| 2 | tech | Tester | 1 | 1 |
| 3 | music | Sejujurnya | 1 | 1 |
| 4 | music | Not Done | 1 | 1 |
| 5 | life | Cinta | 1 | 1 |
| 6 | life | Feel it all | 1 | 1 |
| 7 | life | Not Done | 1 | 1 |
| 8 | truth | Tester | 1 | 1 |
| 9 | tree | Tester | 1 | 1 |
| 10 | climb | Tester | 1 | 1 |
+----+-------------+----------------------+--------+--------+
to
+----+-------------+---------------------------------+--------+--------+
| id | genre.name | song.title | userID | status |
+----+-------------+---------------------------------+--------+--------+
| 1 | tech | Feel it all,Tester | 1 | 1 |
| 2 | music | Sejujurnya, Not Done | 1 | 1 |
| 3 | life | Cinta, Feel it all, Note Done | 1 | 1 |
| 4 | gloom | Feel it aallll | 1 | 1 |
| 5 | buka | Feel it aallll | 1 | 1 |
| 11 | truth | Tester | 1 | 1 |
| 12 | tree | Tester | 1 | 1 |
| 13 | climb | Tester | 1 | 1 |
+----+-------------+---------------------------------+--------+--------+
Thanks
No comments:
Post a Comment