这样应该就可以了
select a.id,a.subject,a.dept,b.sendDate,b.IsSend, max(c.contentType) as contentType
from a left join b on a.id = b.parentid
left join c on a.id = c.parentid
where a.dept = 5
group by a.id,a.subject,a.dept,b.sendDate,b.IsSend
select a.id,a.subject,a.dept,b.sendDate,b.IsSend, max(c.contentType) as contentType
from a left join b on a.id = b.parentid
left join c on a.id = c.parentid
where a.dept = 5
group by a.id,a.subject,a.dept,b.sendDate,b.IsSend
distinct 怎么行?有好多字端呢.
谢谢各位帮助!请大虾继续帮助!
还有其它方法吗?谢谢了!