i want to know what is the difference between Minus and subquery in the below example. I got 2 different results for both. Basically i am trying to find records that exist in the first but not the 2nd table.
Query 1:
select count(*) from (
(select OrderID
from DB.Orders)
MINUS
(SELECT OrderID
FROM DB.Shipments)) as abc;
Query2:
select count(*) from (
select OrderID
from DB.Orders as a1
where a1.OrderID Not in
(SELECT OrderID
FROM DB.Shipments)) as sub;