我用的是sqlserver2000数据库
此数据库里有一个数据表
此数据表里有一个的存储图片地址的字段 images用SQL语句怎么写列出 images 不为空的数据即 select * from xx where x_image !=''或者 select * from xx where x_image !=null或者 select * from xx where x_image !='' and x_image !=null
====================
请问到底如何写才对?

解决方案 »

  1.   

    select * from xx where x_image <>'' and x_image <>null<>这才是不等于哈。
      

  2.   

    select * from xx where x_image is not null
      

  3.   

    其实我在添加数据的时候会判断,如果上传图片为空,则字段image字符串就这么表现:
    TextBox1.Text="";如果上传有图片就TextBox1.Text="图片地址";
    =================
    所以我最好是 select * from xx where x_image <>''就可以了
      

  4.   

    select * from xx where isnull(x_image,-1)=-1 ;//x_image=null时,isnull(x_image,-1)=-1就成立,其实随便写 isnull(x_image,100)=100,isnull(x_image,-31)=-31等等