I'm trying to return the results of a query where two columns columns are not equal to each other.
However, when I run the query the results don't seem to be consistent with the actual data.
As you can see below, I want to return rows where the RatePlanIDs are different.
RatePlans_Supplemental.PIDs
could actually be null, but I never see null results. It also returns duplicates.
I've tried this with muliple queries and they all seem to do the same thing.
I've actually verified it's returning wrong data. It's like the query is inserting values if there's a null. Any idea why?
Update Billing_UnitUsage
Set SuppRateSuccess = 0
FROM Billing_UnitUsage INNER JOIN
RatePlans_Supplemental ON Billing_UnitUsage.SupplementalRateID = RatePlans_Supplemental.UDC_ID AND
NOT(Billing_UnitUsage.RatePlanID = RatePlans_Supplemental.PIDs)