Re: SQL - finding next date

From: "Merlin Moncure" <mmoncure(at)gmail(dot)com>
To: rod(at)iol(dot)ie
Cc: "PostgreSQL General" <pgsql-general(at)postgresql(dot)org>
Subject: Re: SQL - finding next date
Date: 2007-04-12 15:49:09
Message-ID: b42b73150704120849n52cc491ev2fe7a7936c2f5f4b@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 4/12/07, Raymond O'Donnell <rod(at)iol(dot)ie> wrote:
> On 11/04/2007 21:15, Jon Sime wrote:
>
> >> This is probably a very simple one, but I just can't see the answer and
> >> it's driving me nuts. I have a table holding details of academic terms,
>
> Many thanks indeed to all who replied - I particularly like Jeff's
> solution, and will use that one.

I think this is by far the cleanest:

select * from term where start_date > (select start_date from term
where name = 'foo') order by start_date limit 1;

merlin

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jerry Sievers 2007-04-12 16:31:16 Autovac _scale_ settings not changed by SIGHUP?
Previous Message Raymond O'Donnell 2007-04-12 15:10:30 Re: SQL - finding next date