mysql数据库查询添加另一个字段显示数据

select n.*,i.industry_name as industry_name,a.name as create_user_name,
(select GROUP_CONCAT(p.name SEPARATOR ',') from project_relation pr left join project p on p.sign = pr.project_sign where pr.type = 'news' and pr.relation_id = n.id) as project_name
            from news n
            left join industry i on i.id=n.industry_id
            left join sys_admin a on a.id=n.create_user_id
WHERE n.state!='delete' and n.state!='save' and n.id in (select relation_id from project_relation where project_sign = 'learnOnline' and type = 'news')
order  by n.create_time desc

你可能感兴趣的:(数据库笔记,mysql,big,data,数据库)