Re: [SQL] returning the current date in a SQL query - Mailing list pgsql-sql

From Bruce Momjian
Subject Re: [SQL] returning the current date in a SQL query
Date
Msg-id 199808121943.PAA15897@candle.pha.pa.us
Whole thread Raw
In response to Re: [SQL] returning the current date in a SQL query  (Dimitri <dimitri@France.Sun.COM>)
List pgsql-sql
> I think you have to play with UNION:
>
> select ... , project_date from tblprojects where title not in ( '[unknown]',
> 'pending' )
> UNION ALL
> select ... , 'now'::datetime from tblprojects where title = '[unknown]'
> UNION ALL
> select ... , 'now'::datetime from tblprojects where title = 'pending';
>
> It'll be more elegant if you create a VIEW with this query, but
> for the moment UNION is not available in VIEWs...
>
> Hope it helps...
> (dim)

yes, that is on the TODO list.

Not sure it will be in 6.4.  Depend on the rewrite system cleanups.

--
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)

pgsql-sql by date:

Previous
From: Dimitri
Date:
Subject: Re: [SQL] returning the current date in a SQL query
Next
From: Dirk Elmendorf
Date:
Subject: Cursors in Functions