M
mzr
Unregistered / Unconfirmed
GUEST, unregistred user!
如果按上述表结构和记录,把查询View_Sumwmresult和view_Wmresult改为Table表,下面这条SELECT a.DY, a.PH, a.KH, a.KX, (SELECT COUNT(b.dz) AS Zh1 FROM table2 b WHERE (a.kh = b.kh) AND (b.dz < 50) AND (b.dh <> "fk")) AS Zh1, (SELECT COUNT(b.dz) AS Zh1 FROM table2 b WHERE (a.kh = b.kh) AND (b.dz >= 50)and(b.dz<100) AND (b.dh <> "fk")) AS Zh2FROM table1 AS aWHERE (a.DY='01')ORDER BY a.DY, a.PH, a.KX, a.KH;不会报错,得到的结果也是正确。可为什么查询通不过呢