orcale查询语句,在满足A条件的前提下再满足B条件,大神进
发布网友
发布时间:2022-03-08 07:34
我来回答
共1个回答
热心网友
时间:2022-03-08 09:04
select * from table where esixt
(select * from table where substr(cp_rev,1,1) =(select max(substr(cp_rev,1,1)) from table dd where dd.six_pn = '102653' ))
and
(to_number(nvl(substr(cp_rev,2,(length(cp_rev)-instr(cp_rev,'[a-zA-Z]',1,1)-1)),0)))=(select max(to_number(nvl(substr(cp_rev,2,(length(cp_rev)-instr(cp_rev,'[a-zA-Z]',1,1)-1)),0))) from table cc;
子查询的思路,大概模式是这样,具体逻辑没看,自己修改追问用的子查询
with aa
AS(select * from tableA where 条件A)
select * from aa where 条件B;
thk you!!!