Tamar --
I never would have thought of your suggestion, so it's always good to learn new alternatives.
In this case, however, it hardly seems worth the effort. Much easier to just change the field names.
sigh
>>So ... Having 2 # 0
>>
>>????
>
>Sorry, that was a dumb answer. Position works in GROUP BY and ORDER BY. I don't see a solution other than using a different field name. However, if it's important to have the specified field name in the result, do the grouping/having in a derived table and rename the field in the result:
>
>SELECT a as a, b as b, q as c, ... ;
> FROM (SELECT ..., whatever as q .... HAVING q>5)
>
>Tamar
Jim Nelson
Newbury Park, CA