我有以下代码:
INSERT INTO Table_Delete (name)
SELECT su_name
FROM Student_Data
where class = '12'
MINUS
SELECT name
FROM Students
WHERE roll_num in (select roll_num from RollNumber
where class = '12');
COMMIT;
exit
我需要更新此代码以检查Table_Delete = Table_2的内容是否为空Table_delete。 我无法通过If exists命令执行此操作。
有人可以帮我这个吗?我正在使用Oracle 9i。
答案 0 :(得分:1)
select count(*) into ws_count from x where table_delete = table_2;
if(ws_count = 1) then
这样