And, if you want pl/sql, since your scalar subquery expressions
Originally posted by DaPi
depends on the table as a whole and not on any row selected by the
outer query, you can execute them separately:
Code:
declare
v_metatags tblworkingcontent.metatags%type;
v_numerorighe int;
v_cnt1 number;
v_cnt2 number;
begin
select count(*) into v_cnt1
from tblworkingcontent wc2
where wc2.idworkingcontent and wc2.metatags=v_metatags;
select count(*) into v_cnt2
from tblworkingcontent wc3
where wc3.metatags=v_metatags-v_numerorighe;
delete from tblworkingcontent
where metatags=v_metatags
and v_cnt1 < v_cnt2;
end;
/
Tomaž
"A common mistake that people make when trying to design something completely
foolproof is to underestimate the ingenuity of complete fools" - Douglas Adams