Re: problem query ...

From: John Taylor <postgres(at)jtresponse(dot)co(dot)uk>
To: Frank Bax <fbax(at)sympatico(dot)ca>, John Taylor <postgres(at)jtresponse(dot)co(dot)uk>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: problem query ...
Date: 2002-01-31 17:47:21
Message-ID: 02013117472107.01674@splash.hq.jtresponse.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Thursday 31 January 2002 17:35, Frank Bax wrote:
> select mytable.* from mytable, (select id,max(update) as update from
> mytable group by id) maxes where mytable.id = maxes.id and mytable.update =
> maxes.update;
>

I didn't think of putting the subselect there, I was trying in the where clause.
However, I think using distinct on is probably going to run faster.

Thanks
JohnT

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Sammer Reinhard J. 2002-01-31 18:02:26 Re: column headers all in upper-case letters?
Previous Message Frank Bax 2002-01-31 17:35:40 Re: problem query ...