你的位置:首页 > 数据库

[数据库]mysql中查询语句做为条件


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)