select * from a where ''='';
select * from a where ''=null;
select * from a where ''is null;
select * from a where null is '';
select * from a where null ='';
select * from a where null is null;
上面哪一个SQL语句有返回值。
欢迎大家踊跃讨论.

解决方案 »

  1.   

    当然是select * from a where ''is null;和select * from a where null is null;
    有返回值了,判断为空的写法只能是is null, oracle里空可以写成''和null,所以只有这两个对
      

  2.   

    你可以在sys.dual这个表里测试下,我认为有返回值的应该是第3跟第6条:
    select * from a where ''is null;
    select * from a where null is null;
    第四条应该不成立;
      

  3.   

    不是吧,应该是1、6。
    既然是考纯sql,应该和数据库厂商无关的。
      

  4.   

    null在sql里是不能用=号判断的,这是sql基础之基础。
      

  5.   

    select * from a where ''is null;
    select * from a where null is null;
      

  6.   

    在oracle下的测试
    create table a
    (
    column1 varchar2(256)
    )insert into a values('1');
    select * from a where ''='';
    无返回记录select * from a where ''=null;
    无返回记录select * from a where ''is null;
    返回记录select * from a where null is '';
    语法错误select * from a where null ='';
    无返回记录select * from a where null is null;
    返回记录
      

  7.   

    select * from a where null is null;
    select * from a where ''is null;
      

  8.   

    支持redbridge(雪燃) 的说法
      

  9.   

    select * from a where null is null;
    select * from a where ''is null;
      

  10.   

    OracleDBA群35903017,欢迎加入。