Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Check count and then do some work

Dibyendu ChakrabortySep 14 2011 — edited Sep 14 2011
Hi,
I have a table with 10 million records. I want to check whether a value of a specific column is present or not. If the count is greather than 0, then I want to do some task and if it is 0, then I want to do some other task.
Could you please tell me what is the best way to do?
What I am doing now is: I am checking the count using count(*) and then checking the value whether that is greater than 0 or =0 and then based on the value I am doing different task.
But count(*) is slow for this big table.
So, please let me know the best possible way to do this.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 12 2011
Added on Sep 14 2011
8 comments
529 views