select ent.id,ent.enter_name,dis.unit_name,dis.advice,dis.advice_content,case when o.id is null then '未分送' when o.id is not null then '已分送' end statusName,o.id from "
+ " ( select * from lhcj_disciplinary where STATUS_ID=11 ) dis "
+ " left join lhcj_ent ent on dis.id=ent.disciplinary_id "
+ " left join lhcj_opinion o on ent.id=o.ent_id where 1=1 ";
………………………………
此SQL中包含重名字段,两个ID【一个是ent.id 】【一个是o.id】