日期:2014-05-18 浏览次数:20475 次
SELECT sum(val)FROM dbo.T_Main WHERE (ProdCode >= 01000000) AND (ProdCode < 02000000) SELECT sum(val)FROM dbo.T_Main WHERE (ProdCode >= 02000000) AND (ProdCode < 03000000) SELECT sum(val)FROM dbo.T_Main WHERE (ProdCode >= 03000000) AND (ProdCode < 04000000) 改: SELECT sum(val)FROM dbo.T_Main WHERE (ProdCode >= 01000000) AND (ProdCode < 04000000)
------解决方案--------------------
SELECT sum(val)FROM dbo.T_Main WHERE( (ProdCode >= 01000000) AND (ProdCode < 02000000) OR (ProdCode >= 02000000) AND (ProdCode < 03000000) OR (ProdCode >= 03000000) AND (ProdCode < 04000000))