-
problem in query
Hi,
We are facing some problems can anyone help!!!!
I need a query which is based on the following logic
Select count(*) from table where some_cond1; ----(1)
if COUNT(*) = 0 then -----------------------------(2)
SELECT COUNT(*) from table;
else ---------------------------------------------(3)
SELECT count(*) from table where some_cond1;
end if;
i.e in case no rows are existing in the table as specified in (1) we do not need to attach any cond for the query otherwise if rows are existing (3) the query we need to use a where clause. Please note we cannot use a procedure.
regards
Aniruddha
Aniruddha Gupta
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|