I had am maintaining an query that is as follows:
select field_1, field_2
from source_table
minus
select field_1, field_2
from source_table
where status_code in (3, 600);
When I looked at this query, I immediately thought, "That's lame. Why not just use a 'NOT IN' and remove the MINUS business. So I re-wrote it as so:
select field_1, field_2
from source_table
where status_code not in (3, 600);
Just to double-check my sanity, I got counts of each query. To my surprise, the first query returned 789,089 records, and the second query returned 1,518,450 records!
I've looked at this from several angles but can't figure out how these two queries are different. Can anyone explain what is going on, or why I am an idiot this morning?