select * from 表名 where content1<>0 or content2<>0 "<>"才是不等于的意思 ---------------------------<>的作用和!=是一样的,大哥
content1和content2是不是varchar類型? 如果是 select * from 表名 where isnull(content1,'')<>'0' and isnull(content2,'')<>'0'如果是數字類型 select * from 表名 where isnull(content1,1)<>0 and isnull(content2,1)<>0 注意平時我們用isnull(content1,0),現在因為是與0比較﹐所以用isnull(content1,1)﹐只有這樣是空值的才能被選出來
的字样,就选不出来数据了啊,有没有其他的方法啊?
"<>"才是不等于的意思
select * from 表名 where content1<>0 or content2<>0
"<>"才是不等于的意思
---------------------------<>的作用和!=是一样的,大哥
如果是
select * from 表名 where isnull(content1,'')<>'0' and isnull(content2,'')<>'0'如果是數字類型
select * from 表名 where isnull(content1,1)<>0 and isnull(content2,1)<>0
注意平時我們用isnull(content1,0),現在因為是與0比較﹐所以用isnull(content1,1)﹐只有這樣是空值的才能被選出來