这个sql语句怎么写?

有如下两张表
表A:
id taskid area_code keyword advertiser_id order_month
1 1 0 咖啡 1 201108
2 2 1 音乐 2 201108
3 3 0 生活 3 201109

表B:
id keyword synonyms
1 咖啡 咖啡厅
2 咖啡 咖啡屋
3 咖啡 咖啡店
4 音乐 流行音乐
5 音乐 古典音乐
6 生活 恬静的生活
7 生活 安逸的生活
两张表对应的字段是keyword
现在想要如下结果:
area_code keyword order_month synonyms
0 咖啡 201108 咖啡厅,咖啡屋,咖啡店
0 生活 201109 恬静的生活,安逸的生活
1 音乐 201108 流行音乐,古典音乐

oracle 有个函数wmsys.wm_concat
你可以这样
select keyword ,wmsys.wm_concat(synonyms) as synonyms from B group by keyword

这个如果是在oracle下面的话你可以考虑使用嵌套表,其它的数据库我就不清楚了。
mysql下面应该写不出这样的sql,但是写存储过程或者函数可以做这样的事。