select B.ID from A , ( select 'aa' as seq from dual UNION select '123' as seq from dual UNION select '32a' as seq from dual UNION select 'sfs21' as seq from dual UNION ... .... ) as B where B.seq = A.seq(+) and A.seq is null
select substr('v1,v2,v3',1,instr('v1,v2,v3',',',1,1)-1) from dual;
select substr('v1,v2,v3',instr('v1,v2,v3',',',1,1)+1,(instr('v1,v2,v3',',',instr('v1,v2,v3',',',1,1)-1,2)-(instr('v1,v2,v3',',',1,1)+1))) from dual;
这个能取出v1和v2,v3实在太麻烦了,不过你可以参考一下
山水闲人
2024-05-18 04:39:48
你那方法并不笨,但是你的SQL语句有问题 那种写法会将B数据的所有记录读出来再与A表组合产生一个新的集合 我看你的A表数据较少,直接用 select id from ( select 'aa' as id from dual UNION select '123' as id from dual UNION select '32a' as id from dual UNION select 'sfs21' as id from dual UNION ... .... ) B where B.id not in (select A.id from A)