Re: SQL and function reference?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alexander Borkowski <alexander(dot)borkowski(at)abri(dot)une(dot)edu(dot)au>
Cc: "Rodolfo J(dot) Paiz" <rpaiz(at)simpaticus(dot)com>, Michael Fuhr <mike(at)fuhr(dot)org>, pgsql-novice(at)postgresql(dot)org
Subject: Re: SQL and function reference?
Date: 2005-01-26 23:34:49
Message-ID: 23136.1106782489@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Alexander Borkowski <alexander(dot)borkowski(at)abri(dot)une(dot)edu(dot)au> writes:
> How about:

> select *
> from flights
> where date < cast(current_date + interval '30 days ago' as date);

This is the hard way ... you can just add/subtract a date and an
integer, instead:

... where date < (current_date - 30);

regards, tom lane

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Alexander Borkowski 2005-01-26 23:36:02 Re: Formatting a month in query output
Previous Message Alexander Borkowski 2005-01-26 23:26:19 Re: SQL and function reference?