select sum(a),sum(b) from table where id=1出来的结果是有一条数据  但是都是null   我不想要这行  也不想显示为0什么的。就是为空不返回··怎么弄好啊

解决方案 »

  1.   

    select * from (select a = sum(a),b = sum(b) from table where id=1) where a is not null and b is not null这样?
      

  2.   

    不行···关键字 'where' 附近有语法错误。
      

  3.   

    select sum(a),sum(b) from table where id=1 having sum(a) is not null or sum(b) is not null
      

  4.   

    havingselect sum(a),sum(b) from table where id=1 having sum(a) is not null and sum(b) is not null
      

  5.   


    select * from 
    (select a=sum(a),b=sum(b) from excelTest where id=1) t 
    where t.a is not null and t.b is not null
      

  6.   


    select * from (select a = sum(a),b = sum(b) from table where id=1)T
     where a is not null and b is not null
      

  7.   

    不好意思 4楼···没看到你那个···sorry···