我有列date_check,并且用户以参数形式输入S来检查列是否为空或不为空。所以我认为应该这样,但我需要您的帮助
select date_check
from tableA
if :parametar='S' then give me date_check where date_check is not null
所以在这里我不知道如何编写函数的正确语法
尝试这个:
select date_check
from tableA
where (:parametar='S' AND date_check IS NOT NULL)
OR date_check IS NULL
如果parametar
为is,S
则返回非null值date_check,否则返回null
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句