Check count and then do some work
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.