There is a table with a field called "ContractType" I want to return
all rows which are not equal to 'Customer buy'. There are records
which have NULL values in this field, and I want to return those records:
Select * from myTable
Where ContractType <> 'Customer buy'
But this query doesn't return the records with ContractType value of NULL.
Brett's should have worked. Are you sure you are dealing with NULLS and not zero-length strings? A zero-length string is not null, but is actually a string with no characters (sounds like we're entering the quantum world...).
Where ContractType <> 'Customer buy' or nullif(ContractType, '') is null