Re: NEWBIE: conditional query

From: Lun Wing San (Oracle) <"Lun>
Date: 1996/11/20
Message-ID: <32932FB2.61FF_at_qrcsun.qrc.org>#1/1


Peter Wenker wrote:
>
> I'm trying to select different values from a DATE field based upon the
> value of the date. Specifically, I want to query all rows in a table with
> a DATE field. I want the query to return a value of 'CLOSED' if the date
> is less than or equal to SYSDATE, and NULL if the date is greater than
> SYSDATE. Is this possible? I'm familiar with SQL*PLUS but not as
> familiar with its advanced functionality.

  select date_colname, 'CLOSED' from tablename where date_colname <= SYSDATE   union
  select date_colname, null from tablename where date_colname > SYSDATE

---
Name   : Lun Wing San
Title  : Oracle Application Developer of Hong Kong Productivity Council
         Oracle Database Administrator and System Administrator of QRC
Phone  : (852)27885841
Received on Wed Nov 20 1996 - 00:00:00 CET

Original text of this message