Re: Can EXCEPT Be Used for To Solve This Problem?

From: "Mark R(dot) Dingee" <mark(dot)dingee(at)cox(dot)net>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Can EXCEPT Be Used for To Solve This Problem?
Date: 2005-08-25 15:06:40
Message-ID: 200508251106.41540.mark.dingee@cox.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

you can also do

select ... order by update_time desc offset 1 limit 1

On Thursday 25 August 2005 10:47 am, Vivek Khera wrote:
> On Aug 24, 2005, at 4:47 PM, Lane Van Ingen wrote:
> > I want to select 2nd oldest transaction from foo (transaction 3). The
> > solution below
> > works, but I think there may be a better way. Does anyone else have
> > a better
> > idea?
>
> why not just select order by update_time desc limit 2 then discard
> the first row you fetch?
>
>
> Vivek Khera, Ph.D.
> +1-301-869-4449 x806
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
> choose an index scan if your joining column's datatypes do not
> match

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Bath, David 2005-08-26 03:04:10 Tidying values on variable instantiation
Previous Message Vivek Khera 2005-08-25 14:47:19 Re: Can EXCEPT Be Used for To Solve This Problem?