Received: from candle.pha.pa.us (root@s5-03.ppp.op.net [209.152.195.67]) by hub.org (8.8.8/8.7.5) with ESMTP id QAA25186 for ; Wed, 12 Aug 1998 16:00:20 -0400 (EDT) Received: (from maillist@localhost) by candle.pha.pa.us (8.8.5/8.8.5) id PAA15897; Wed, 12 Aug 1998 15:43:31 -0400 (EDT) From: Bruce Momjian Message-Id: <199808121943.PAA15897@candle.pha.pa.us> Subject: Re: [SQL] returning the current date in a SQL query In-Reply-To: <9808122134240I.00535@dimitri> from Dimitri at "Aug 12, 1998 9:29:49 pm" To: dimitri@France.Sun.COM Date: Wed, 12 Aug 1998 15:42:16 -0400 (EDT) Cc: walt@stimpy.com, pgsql-sql@postgreSQL.org X-Mailer: ELM [version 2.4ME+ PL43 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit > 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)