如何将子查询改造为left join方式查询,请高手指教一下,比如:select * from train_plan_name a where a.TP_APPROVAL_STATE = 0 and a.tp_id in(select b.tp_id from train_plan_name b where b.TP_PERSONID = 1 or b.tp_app_id =1 ),从同一个表中查询语句如何改造成左关联查询呢?
select distinct A.* from train_plan_name a left join train_plan_name b on a.tp_id = b.tp_id
where a.TP_APPROVAL_STATE = 0 and b.TP_PERSONID = 1 or b.tp_app_id =1