我用mysql,有一个product表,表中有product_size字段,有些记录product_size中有值,有些记录中没有。
如何将product_size中有值的记录查询出来,不要没有值的记录?
谢谢。

解决方案 »

  1.   

    select * from product where product_size<> null
    看对不?
      

  2.   

    错了 是select * from product where product_size<>‘’  
      

  3.   

    SELECT * from product where LENGTH(product_size)>0
      

  4.   

    上面的都不对,应该是这样的:select   *   from   product   where   product_size <> 'NULL' .大家试试,对的话,顶!!!
      

  5.   

    上面的都不对,应该是这样的:select   *   from   product   where   product_size <>  'NULL',请大家试试,如果对的话,就顶!!!