select distinct t.demandNo
from t_aaa t, t_bbb o
where 1=1 and t.Id=o.Id
and t.demandNo not in
(select t.demandNo from t_aaa t, t_bbbo where 1=1 and t.Id=o.Id and o.status=3 order by t.demandNo DESC)
时间: 2024-11-04 20:08:19
select distinct t.demandNo
from t_aaa t, t_bbb o
where 1=1 and t.Id=o.Id
and t.demandNo not in
(select t.demandNo from t_aaa t, t_bbbo where 1=1 and t.Id=o.Id and o.status=3 order by t.demandNo DESC)