Re: simple query question: return latest

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Goutam Paruchuri <gparuchuri(at)oneil(dot)com>
Cc: Scott Frankel <leknarf(at)pacbell(dot)net>, pgsql-general(at)postgresql(dot)org
Subject: Re: simple query question: return latest
Date: 2004-11-12 16:24:07
Message-ID: 20041112162406.GA22319@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

[Top-posting fixed]

On Fri, Nov 12, 2004 at 09:06:08AM -0500, Goutam Paruchuri wrote:

> Scott Frankel wrote:
>
> > ORDER BY DESC LIMIT 1 is much simpler and more readable than a
> > sub-query. Though the sub-query approach looks to be a good template
> > for ensuring more accurate results by being more explicit.

Scott, how would a subquery "ensure more accurate results by being
more explicit"?

> If 2 days are equal for color red, you still would get 2 rows returned.

How do you figure, given the presence of LIMIT 1?

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Frankel 2004-11-12 17:04:09 Re: simple query question: return latest
Previous Message Michelle Konzack 2004-11-12 16:20:59 Re: How many secondary databases can I create?