Re: Help with query involving aggregation and joining.

From: <mallah(at)trade-india(dot)com>
To: <ch(at)rodos(dot)fzk(dot)de>
Cc: <pgsql-sql(at)postgresql(dot)org>, <mallah(at)trade-india(dot)com>
Subject: Re: Help with query involving aggregation and joining.
Date: 2003-02-24 15:51:37
Message-ID: 1037.219.65.254.132.1046101897.squirrel@mail.trade-india.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

sorry i did not post any sample data or definations.
i was replying to someone else's posting

i do get such an error on pgsql 7.3.2

regds
mallah.

>>
>> ERROR:
>> SELECT DISTINCT ON expressions must match
>> initial ORDER BY expressions may be gotten over by
>> wrapping the first query result in a subselect.
>>
>> not sure though if its proper.
>> regds
>> mallah.
>>
>> test=# SELECT * from ( SELECT distinct on (a.id) b.id
>> ,courseid,name,submission from course a join history b on
>> (a.id=b.courseid) ) as results order by results.submission desc;
>>
> I'm currently working with
> select version();
> version
> ---------------------------------------------------------------
> PostgreSQL 7.2.3 on hppa-hp-hpux10.20, compiled by GCC 2.95.2
> (1 row)
> I've used your table definitions and sample data you've sent earlier and do not receive an
> error message on the above SELECT statement. Did you?
>
> Regards, Christoph

-----------------------------------------
Get your free web based email at trade-india.com.
"India's Leading B2B eMarketplace.!"
http://www.trade-india.com/

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Bruno Wolff III 2003-02-24 17:16:33 Re: Help with query involving aggregation and joining.
Previous Message Tom Lane 2003-02-24 15:30:14 Re: syntax question