- 使用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删除。