存储过程里select count(*) from A where A.type=' ';可以查出数据
而在PL/SQL里,select count(*) from A where A.type=' '却无数据。都在同一数据库同一张表里。
这个是为什么呢?请各位大侠指导指导。。

解决方案 »

  1.   


    select count(*) from A where A.type=' '
    --你会不会写错了
    select count(*) from A where A.type='' --注意' '和''的差别
      

  2.   

    我再看看,那个空格那个肯定没写错,有可能存储过程中 那个A.type的值给转换了,我去看看
      

  3.   

    区分下 ' ' 和''
    在oracle数据库中' ' 代表长度为1的空串,但是''却代表null 
    这样解释应该理解吧
      

  4.   


    试试select length(type) from a---看其结果就明白