Graeme St. Clair [mailto:[EMAIL PROTECTED] wrote:
> 
> I just tripped over a curious thing.  It turned out that my d-b contained
> the occasional column with accidental leading blanks.  I altered the query
> to:-
> 
>  SELECT TRIM(LEADING ' ' FROM CUST_NAME) AS CN, COUNT(*) AS C FROM DB
> GROUP
> BY CN ORDER BY CN
> 
> and ir barfed "00904 Invalid column name..." at:-
> 
>  ...GROUP BY <*>CN...
> 
> It worked when I put the full TRIM expression in place of the
> abbreviation/alias CN.
> 
> Is it meant to work like that?  If so, why?

Oracle does not allow you to use SELECT aliases in the GROUP BY clause.

Ronald


Reply via email to