Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL Default Return
"abc" <abc_at_abc.com.au> wrote in message news:<b3h2lq$dcq$1_at_mws-stat-syd.cdn.telstra.com.au>...
> Hi,
>
> I have a simple SQL
>
> SELECT DECODE(a.date, NULL, 'Date Not Exists', a.date) as Date FROM CALENDAR
> WHERE date = '01-JAN-2003'
>
> '01-JAN-2003' is not in CALENDAR Table then I must expect a Default return
> as 'Date Not Exists'. But that doesn't work.
>
> Anyone knows how to get this Default Return if No rows return.
>
You can force a null using an aggregate function, in this example it has no other purpose.
SQL> select * from t;
D
DECODE(MA
DECODE(MA
Hth
Martin Received on Wed Feb 26 2003 - 07:41:21 CST
![]() |
![]() |