mjcmkrsr
Technical User
- Nov 30, 2010
- 840
Hi
Strange behavior of SELECT ... GROUP BY ... HAVING ...
Is there an explanation why you have to put "" around the Alias Name in HAVING COUNT(...)
Thanks
MarK
Strange behavior of SELECT ... GROUP BY ... HAVING ...
Code:
SELECT cName from stagiaires GROUP BY cName HAVING COUNT(cName) > 1 &&& works
SELECT SUBSTR(cName,1,15) as cTrunkName from stagiaires GROUP BY cTrunkName HAVING COUNT(cTrunkName) > 1 &&& yields an error
SELECT SUBSTR(cName,1,15) as cTrunkName from stagiaires GROUP BY cTrunkName HAVING COUNT("cTrunkName") > 1 &&& works
Is there an explanation why you have to put "" around the Alias Name in HAVING COUNT(...)
Thanks
MarK