Re: problem with distinct rows

From: tony <tony(at)tgds(dot)net>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: postgres list <pgsql-general(at)postgresql(dot)org>
Subject: Re: problem with distinct rows
Date: 2005-03-08 11:22:35
Message-ID: 1110280956.3566.34.camel@hush
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2005-03-08 11:29:01 Re: problem with distinct rows
Previous Message John Sidney-Woollett 2005-03-08 10:38:16 Re: problem with distinct rows