Re: [SQL] returning the current date in a SQL query

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: dimitri(at)France(dot)Sun(dot)COM
Cc: walt(at)stimpy(dot)com, pgsql-sql(at)postgreSQL(dot)org
Subject: Re: [SQL] returning the current date in a SQL query
Date: 1998-08-12 19:42:16
Message-ID: 199808121943.PAA15897@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)candle(dot)pha(dot)pa(dot)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)

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Dirk Elmendorf 1998-08-12 20:31:29 Cursors in Functions
Previous Message Dimitri 1998-08-12 19:29:49 Re: [SQL] returning the current date in a SQL query