Declare @param char(1)
SET @param = 'A'
@param can be 'A','B' or 'C'
SELECT x, y FROM myTbl
WHERE y = @param
if @param = 'A' or 'B' then y = @param works fine if @param = 'C' then I want to WHERE to fetch the rows where y IS NULL
I could achieve this using dynamic sql but can't figure out how to do it without dynamic sql. Any thoughts?
mysql,postgresql,sql-server,oracleordb2- or something else entirely.