pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mark R. Dingee <mark.dingee@cox.net>
To: pgsql-sql@postgresql.org
Subject: Re: Can EXCEPT Be Used for To Solve This Problem?
Date: Thu, 25 Aug 2005 11:06:40 -0400
Message-ID: <200508251106.41540.mark.dingee@cox.net> (raw)
In-Reply-To: <6A9A99AA-E7AF-4922-8B79-75A370582E63@khera.org>
References: <EKEMKEFLOMKDDLIALABIMEMGCBAA.lvaningen@esncc.com>
	<6A9A99AA-E7AF-4922-8B79-75A370582E63@khera.org>

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



view thread (6+ messages)

Message-ID: <200508251106.41540.mark.dingee@cox.net>
Permalink:  ../200508251106.41540.mark.dingee@cox.net/
Also on:    postgresql.org/message-id/200508251106.41540.mark.dingee@cox.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: mark.dingee@cox.net
  Subject: Re: Can EXCEPT Be Used for To Solve This Problem?
  In-Reply-To: <200508251106.41540.mark.dingee@cox.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox