select nvl(字段,'') into 变量 from 表  where 条件;

解决方案 »

  1.   

    select max(字段) into 变量 from 表  where 条件
      

  2.   

    ...
      begin
         select 字段 into 变量 from 表  where 条件;
      exception when no_data_found then
         变量:=null;
      end;
    ...
      

  3.   

    同意楼上的写法。
    freeprogramer()的写法是不对的,它只能将满足条件,字段值为null的值返回。即没有记录发现不等于这个字段的值为null。
    Lastdrop(空杯) 的写法应该是对的,但我没有试过,一般我用楼上的方法。