mysql 多行数据一行显示sql
select r.id,d.`name`,t.number,t.approval from reform r , document t, dm_department d where r.id = t.rid and t.did = d.id ;
运行结果:
mysql 多行数据一行显示sql:(利用GROUP_CONCAT函数)
select r.id,GROUP_CONCAT(d.`name`),GROUP_CONCAT(t.number),GROUP_CONCAT(t.approval) from reform r,document t ,dm_department d where r.id = t.rid and t.did = d.id GROUP BY r.id;
运行结果:
本文原创,转载必追究版权。