Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Always return at least one value

RE: Always return at least one value

From: <Stephen.Lee_at_DTAG.Com>
Date: Fri, 19 Mar 2004 10:45:35 -0600
Message-ID: <D6339830FC73944E889CC3CEADDB205B0790929E@bu-dtagpo1.tracs.com>

Yeah. I was hoping I could avoid that additional select to check the existence of the character in the table. With all the new functions that keep popping up in Oracle SQL, I was hoping maybe there was one that was like: If no rows then return this thing, otherwise give me the rows.

> -----Original Message-----
>
> How about this:
> select field from table where field='LITERAL'
> union all
> select '-' from dual
> where not exists(select field from table where field='LITERAL');
>
> I think that ought to do it....
>
> -Mark
>



Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------
Received on Fri Mar 19 2004 - 10:41:58 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US