RE: Always return at least one value

  • From: Stephen.Lee@xxxxxxxx
  • To: oracle-l@xxxxxxxxxxxxx
  • Date: Fri, 19 Mar 2004 10:45:35 -0600

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@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at //www.freelists.org/archives/oracle-l/
FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------

Other related posts: