Re: select distinct and order by

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: newsreader(at)mediaone(dot)net
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: select distinct and order by
Date: 2001-08-16 05:56:33
Message-ID: Pine.BSF.4.21.0108152248060.77073-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Thu, 16 Aug 2001 newsreader(at)mediaone(dot)net wrote:

> Pg complained that select distinct column and
> order by column must be the same.

Depending on what you are doing, you may be able to
use group by with an explicit set value function on
the sort by field (for example:
select foo from table group by foo order by min(bar);)

(I don't know anything about the dbi interface really, so i'll
leave that part for someone who does)

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dr. Evil 2001-08-16 06:02:00 Storing images in PG?
Previous Message newsreader 2001-08-16 05:18:57 select distinct and order by