I’m trying to write a query that will set a bit value, based on whether another column is null or not.
For example:
UPDATE @tmpRank
SET IsXYSale = NOT dbo.Sales_XForY.ID IS NULL
FROM @tmpRank
LEFT JOIN dbo.Sales_XForY ON SaleId = @tmpRank.SaleId
I’m getting a syntax error on the NOT keyword, but I can’t see how to correct the query.
1 Answer