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】
本文探讨了一段包含重名字段的SQL语句,具体涉及两个ID字段的使用场景:一个是ent.id,另一个是o.id。文章深入分析了这种设计可能带来的问题,并提供了理解和解决这一问题的思路。

被折叠的 条评论
为什么被折叠?



