ColdFusion supports the use of any arbitrary arithmetic expression, as long as it is referenced by an alias.
The following code is correct:
SELECT (lorange + hirange)/2 AS midrange,
COUNT(*) FROM royschedGROUP BY midrange;
The following code is correct:
SELECT (lorange+hirange)/2AS x
,COUNT(*)
FROM royschedGROUP BY x
HAVING x > 10000;
The following code is not supported in Query of Queries:
SELECT (lorange + hirange)/2 AS midrange,
COUNT(*) FROM royschedGROUP BY (lorange + hirange)/2;