1.情景展示 现在有两者表,表1中的主键id字段和表2的index_id相对应.如何删除两表非关联数据? 2.解决方案 --第1步 delete from VIRTUAL_CARD t where t.index_id not in (select id from PRIMARY_INDEX); --第2步 delete from PRIMARY_INDEX t where t.id not in (select index_id from VIRTUAL_CARD); 说明: 如果in()…
One cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1..N is going to attend the big cow party to be held at farm #X (1 ≤ X ≤ N). A total of M (1 ≤ M ≤ 100,000) unidirectional (one-way roads connects pairs of farms; road i requires Ti (1…
CREATE OR REPLACE PROCEDURE del_p --建立名为del_p 的过程 IS CURSOR get_abid --简历名为get_abid的cursor 用来存放a表的id和b表的id. IS SELECT a.ID aid, b.ID bid FROM userinfo a INNER JOIN users b ON a.username = b.username; --将a表的id命名为aid,b表的id命名为bid BEGIN FOR rec_abid IN g…