新 新来的菜鸟 Unregistered / Unconfirmed GUEST, unregistred user! 2009-08-17 #1 有个表testa1 name12 zs34 zs12 wa45 ls23 zs我想用一条sql统计出总数大于50的sql如何写 类似于这个意思select name from test where sum(a1) > 50 group by a1
有个表testa1 name12 zs34 zs12 wa45 ls23 zs我想用一条sql统计出总数大于50的sql如何写 类似于这个意思select name from test where sum(a1) > 50 group by a1
D de410 Unregistered / Unconfirmed GUEST, unregistred user! 2009-08-17 #2 SELECT name,aFROM (SELECT SUM(a1) AS a, name FROM test GROUP BY name) DERIVEDTBLWHERE (a > 50)或者SELECT SUM(a1) AS a, name FROM test GROUP BY name HAVING (a > 50)
SELECT name,aFROM (SELECT SUM(a1) AS a, name FROM test GROUP BY name) DERIVEDTBLWHERE (a > 50)或者SELECT SUM(a1) AS a, name FROM test GROUP BY name HAVING (a > 50)
Z zbdzjx Unregistered / Unconfirmed GUEST, unregistred user! 2009-08-18 #3 同意楼上的,如果是对结果进行刷选,则必须用having语句。