Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Simple IF statement
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
![]() |
![]() |