Having brain freeze and could use some help with this SQL...
I want to select the good and bad records from the same table and return the results in the same statement:
What I have tried to this point does not work but looks something like:
select count(good), count(bad) from (
select reject_code good from final_collection where date_made > sysdate - 12/24
and reject_code = 'GOOD'
union all
select reject_code bad from final_collection where date_made > sysdate - 12/24
and reject_code <> 'GOOD'
)
I figure I am missing something simple, but no luck so far.
When I understand this better I plan to add the same type query for good/bad from additional tables.
Any assistance is greatly appreciated.
John Joehnk
I want to select the good and bad records from the same table and return the results in the same statement:
What I have tried to this point does not work but looks something like:
select count(good), count(bad) from (
select reject_code good from final_collection where date_made > sysdate - 12/24
and reject_code = 'GOOD'
union all
select reject_code bad from final_collection where date_made > sysdate - 12/24
and reject_code <> 'GOOD'
)
I figure I am missing something simple, but no luck so far.
When I understand this better I plan to add the same type query for good/bad from additional tables.
Any assistance is greatly appreciated.
John Joehnk