I'm trying to select some rows when a specific column are equal to my variable. Some of these rows have that column set as null.
For this, i made a query using a variable to get that match
SELECT
MT.Column1,
MT.Column2,
MT.SpecificColumn
FROM
MyTable MT
WHERE
MT.SpecificColumn = :Variable
So, it happens that when this variable receives NULL, the query doesn't return the rows that have the SpecificColumn value NULL.
The only way i got the rows was using this condition:
WHERE
MT.SpecificColumn IS NULL
but that case doesn't fit to me, because i need it to be dynamic.