MYSQL一对多,两表查询合并数据

select a.askid,a.title,GROUP_CONCAT(b.message SEPARATOR '----') as content from gg_ask as a join gg_ask_posts as b
on a.askid=b.askid GROUP BY a.askid;

 

posted @ 2015-04-14 08:49  3000  阅读(1409)  评论(0编辑  收藏  举报