SQL2000查询视图的疑问
SQL2000查询视图的疑问
查询如下视图字段
SELECT viptraderid, MaterialID, LLqcqty, LLsrqty, llfcqty, lljcqty, Code
FROM dbo.vip_lljgsfczhbb
112.0000000000.0000000000.0000000000.00000000001010001
41114.0000000000.0000000000.0000000000.00000000005010004
4132599.0000000000.0000000000.000000000099.00000000001060030
58112.0000000000.0000000000.0000000000.00000000005010002
58116.0000000000.0000000000.0000000000.00000000005010006
58364.0000000000.0000000000.0000000000.00000000004010016
58365.0000000000.0000000000.0000000000.00000000004010017
1/为什么如下语句查询不到内容呢? ()
SELECT viptraderid, MaterialID, LLqcqty, LLsrqty, llfcqty, lljcqty, Code
FROM dbo.vip_lljgsfczhbb
where LLqcqty<>0 and LLsrqty<>0 and llfcqty<>0 and lljcqty<>0
2/为什么如下查询却可以正常查询到结果
SELECT viptraderid, MaterialID, LLqcqty, LLsrqty, llfcqty, lljcqty, Code
FROM dbo.vip_lljgsfczhbb
where LLqcqty=0 and LLsrqty=0 and llfcqty=0 and lljcqty=0
112.0000000000.0000000000.0000000000.00000000001010001
41114.0000000000.0000000000.0000000000.00000000005010004
58112.0000000000.0000000000.0000000000.00000000005010002
58116.0000000000.0000000000.0000000000.00000000005010006
58364.0000000000.0000000000.0000000000.00000000004010016
58365.0000000000.0000000000.0000000000.00000000004010017
[解决办法]
做了一个实验,你可以看看:
select case when .0000000000 = 0 then '相等' else '不相等' end
/*
相等
*/