- 使用exsits 如下:
do
$$
begin
if exists(select * from res_partner where 1!=1) then
raise notice 'ererrrr';
end if;
end;
$$;
- 還有一種比較蠢的方法:使用
count
來獲取返回的結果,然后判斷count的值是否為零.
do
$$
begin
if exists(select * from res_partner where 1!=1) then
raise notice 'ererrrr';
end if;
end;
$$;
count
來獲取返回的結果,然后判斷count的值是否為零.
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。