SQL

SQL

Made by DeepSource

Unidiomatic NULL checks SQL-L049

Style
Minor

Comparisons with NULL should use “IS” or “IS NOT”.

Bad practice

In this example, the = operator is used to check for NULL values.

SELECT
    a
FROM foo
WHERE a = NULL

Recommended

SELECT
    a
FROM foo
WHERE a IS NULL