Need some help on this query. So far I have it returning a count based on data from couple days previous.
What I am ultimately trying to do now is create a query that basically tells me if the count(*)=Xn value, then query is valid else no data set.
Its ok if I get no results.
Here’s my query:
SQL> select count(*) from in_source where to_date(year||'/'||month||'/'||day, 'YYYY/MM/DD') >= trunc(sysdate) - 1;
COUNT(*)
----------
500
So, basically if count(*)=500 then this query is 1 (false) or 0 (no results). I’m thinking this would require a sub query?
Can someone help me tweak this? Thank you.
Don’t really understand what you are after, but hopefully one of these will work..
If you are trying to get if count(*) = 500 return a 1 else return a 0 then try this:
If you are trying to get if count(*) = 500 then return a 1 else don’t return any rows try this: