mysql> select ta.id,ta.name,group_concat(tb.id order by tb.value separator ',')
as tbid,
-> group_concat(tb.value order by tb.value separator ',') as tbvalue from ta
,tb where tb.aid=
-> ta.id group by ta.id;
+------+------+-------+---------+
| id | name | tbid | tbvalue |
+------+------+-------+---------+
| 00 | 0a | b0,b1 | b0,b1 |
| 01 | 0b | b2 | b2 |
| 03 | 0d | b3,b4 | b3,b4 |
+------+------+-------+---------+
3 rows in set (0.00 sec)