I am working with a datawarehouse table that has can be split into claimed rows, and computed rows. I suspect that the computed rows are perfect duplicates of the claimed row (with the exception of the claimed/computed column).
I tried to test this using the except clause:
But all of the records were returned. I don't believe that this is possible, and I suspect it's due to null values.
Is there a way to compare the records which will compare nulls to nulls?
SELECT a, b, c FROM table WHERE clm_cmp_cd = 'clm'
EXCEPT
SELECT a, b, c FROM table WHERE clm_cmp_cd = 'cmp'
But all of the records were returned. I don't believe that this is possible, and I suspect it's due to null values.
Is there a way to compare the records which will compare nulls to nulls?
edit: the solution should work with an arbitrary number of fields, with varying types. In this case, I have ~100 fields, 2/3 of which may have null values. This is a data warehouse, and some degree of denormalization must be expected.
edit: I tested the query while limiting myself to non-null columns, and I got the result I expected (nothing). But, I would still like to compare fields which potentially contain null values.