postgres 判断查询结果集为空,判断查出出来的记录为零
- 使用exsits 如下:
do
$$
    begin
    if exists(select * from res_partner where 1!=1) then
        raise notice 'ererrrr';
    end if;
    end;
$$;
- 还有一种比较蠢的方法:使用count来获取返回的结果,然后判断count的值是否为零.
本文来自博客园,作者:那时一个人,转载请注明原文链接:https://www.cnblogs.com/qianxunman/p/13962228.html
 
                    
                     
                    
                 
                    
                
 
 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号