Alternativně k ISNULL
/ COALESCE
možnosti, můžete otestovat parametry, zda jsou null:
SELECT NAME
FROM TABLE
WHERE
(@City IS NULL OR City = @City)
AND
(@Gender IS NULL OR Gender = @Gender)
AND
(@Age IS NULL OR Age = @Age)
Alternativně k ISNULL
/ COALESCE
možnosti, můžete otestovat parametry, zda jsou null:
SELECT NAME
FROM TABLE
WHERE
(@City IS NULL OR City = @City)
AND
(@Gender IS NULL OR Gender = @Gender)
AND
(@Age IS NULL OR Age = @Age)