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

Home -> Community -> Usenet -> c.d.o.misc -> Simple IF statement

Simple IF statement

From: Dan Fluet <dfluet_at_bdsinc.com>
Date: Mon, 23 Aug 1999 10:54:49 -0400
Message-ID: <37C160B8.FCF11D5C@bdsinc.com>


I know this should be easy but it is Monday.

In SQL Server there is an IF EXISTS function. Is there anything similiar to that in Oracle? Here is a simplified query of what I am trying to do.

If there is something in the daily_sales do the first select if not do the second.

BEGIN
 IF (SELECT COUNT(*) FROM daily_sales) < 1 THEN   SELECT * FROM author;
 ELSE
  SELECT * FROM other;
 END IF;
END; Received on Mon Aug 23 1999 - 09:54:49 CDT

Original text of this message

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