SQL: select一组数据,concat同表同列的数据

select f.name as name,
group_concat(distinct m.name) as module
from files f
inner join module m
on (f.module_id = m.id)
where f.name = ?
and f.environment = ?

 

concat 连接字符串

group_concat 连接同组字符串

posted @ 2015-12-21 17:59  Ray.Yang  阅读(384)  评论(0编辑  收藏  举报