I have a select statement
SELECT QBalance
FROM dbo.CustomerBalance
WHERE (CustomerID = 1) AND (MarchentID = @MerchantId)
I want to check if that statement returns 0 rows. I tried to use the ISNULL and IFNULL but it seems that I’m missing something.
To find out whether no matching rows exist you can use
NOT EXISTS. Which can be more efficient than counting all matching rows