Re: SQL and function reference? - Mailing list pgsql-novice

From Tom Lane
Subject Re: SQL and function reference?
Date
Msg-id 23136.1106782489@sss.pgh.pa.us
Whole thread Raw
In response to Re: SQL and function reference?  (Alexander Borkowski <alexander.borkowski@abri.une.edu.au>)
List pgsql-novice
Alexander Borkowski <alexander.borkowski@abri.une.edu.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

pgsql-novice by date:

Previous
From: Alexander Borkowski
Date:
Subject: Re: SQL and function reference?
Next
From: Alexander Borkowski
Date:
Subject: Re: Formatting a month in query output