2012-02-16 74 views

回答

1

您必須添加條件之間ANDOR運營商。您可以應用分組。

SELECT * 
FROM tableName 
HAVING (COUNT(colA) > 4 AND MAX(colB) = 3) OR 
     SUM(colC) > 100 
3

沒有逗號,使用ANDS

HAVING COUNT(t2.ID) > 0 and COUNT(t3.ID) > 0 

有一定導致一個布爾表達式來檢查是否分組結果被過濾或不被過濾。

0

嘗試

Having count(t2.id) > 0 and count(t3.id) > 0