Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有将给出空值的参数。我想要 where 条件,当参数为空时,我将在所有列中获取 NULL 值。
提前致谢
根据您的描述,我认为这会起作用:
WHERE (@parameter1 IS NULL AND COLUMN1 IS NULL) OR (@parameter1 IS NOT NULL AND COLUMN1 = @parameter1)