Re: problem with distinct rows - Mailing list pgsql-general

From tony
Subject Re: problem with distinct rows
Date
Msg-id 1110280956.3566.34.camel@hush
Whole thread Raw
In response to Re: problem with distinct rows  (Martijn van Oosterhout <kleptog@svana.org>)
Responses Re: problem with distinct rows  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-general
Le mardi 08 mars 2005 à 11:04 +0100, Martijn van Oosterhout a écrit :
> You can put the DISTINCT ON() query as a subquery, and an ORDER BY in
> the outer query.

That was my first guess

select number.inventorynumber, name, first_name
from (select distinct on (inventorynumber) inventorynumber from works)
as number, artist, blah
order by name

???

> Sorting by surname is tricky since you need to tell the computer how to
> find it...

in artist table we have name, first_name etc so no problem there

Tony




pgsql-general by date:

Previous
From: John Sidney-Woollett
Date:
Subject: Re: problem with distinct rows
Next
From: Martijn van Oosterhout
Date:
Subject: Re: problem with distinct rows