Skip to content
Advertisement

The function processes the sql request

The function processes the sql request. It receives parameters and one of them can be either “null” or a value (uuid), I need to add this value to where. But there is a problem, because with null “where param is null”, but with the value “where param = value”

Example

Advertisement

Answer

In sql, null = null and null <> null always evaluate to false because null values are treated as unknown and can’t be considered equal or unequal to each other.

But two null values are not distinct from each other, so null is not distinct from null evaluates to true.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement