> select s1.channelname as channelname, s1.id as channelid,
> count(*) as anz from mgw_news n left join mgw_news_channels s1 on
> n.channelid = s1.id group by channelid, channelname order by channelid,
> this runs under mysql and postgresql seems not to accept aliases in group by
> cause when i'm changing channelid to s1.id it works perfectly
I believe that the PostgreSQL behavior, i.e. not accepting the real names of
columns that have been aliased, is the SQL92 standard behavior. Certainly it
prevents a certain confusion in the query parser in the case of multiple
references to an aliased column.
In other words, I believe that the behavior you are observing is by design and
is not a bug. Please keep in mind that MySQL does *not* uphold the SQL92
standard, so it cannot be used as an index of proper behavior. So, change
your GROUP BY reference.
However, the behavior you mention should certainly be mentioned in one or more
of the porting articles at TechDocs ( http://techdocs.postgresql.org/ ).
E-mail one of the authors if it's not.
______AGLIO DATABASE SOLUTIONS___________________________
Complete information technology josh(at)agliodbs(dot)com
and data management solutions (415) 565-7293
for law firms, small businesses fax 621-2533
and non-profit organizations. San Francisco
In response to
- group by at 2002-01-15 18:49:45 from Ewald Geschwinde
pgsql-novice by date
|Next:||From: Tom Lane||Date: 2002-01-15 20:03:52|
|Subject: Re: group by |
|Previous:||From: Ewald Geschwinde||Date: 2002-01-15 18:49:45|
|Subject: group by|