不是判断是否为 null  是当主键为某个值时 表中是否有一条记录,有返回0,没有返回1  求助一下各位大神

解决方案 »

  1.   

    用个decode就好了:decode(count(pk),0,1,0)
      

  2.   

    select sign(count(*)) from user_tables where table_name = 'TEST'
      

  3.   

    用case when  where 条件 用is not Null 不行吗?
      

  4.   

    select decode(count(pk),0,1,0) from table where pk=?
      

  5.   

    主键为某个值时,是不是就说明了,其实有这条记录,仅是判断某个字段是否有值。
    如果是这样的,可以用decode,也可以用nvl