Search Postgresql Archives

Re: problem with distinct rows

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux