Oracle PL\SQL Null Input Parameter WHERE condition

前端 未结 2 726
花落未央
花落未央 2021-02-10 13:02

As of now I am using IF ELSE to handle this condition

IF INPUT_PARAM IS NOT NULL

    SELECT ... FROM SOMETABLE WHERE COLUMN = INPUT_PARAM
ELSE
    SELECT ... FR         


        
2条回答
  •  独厮守ぢ
    2021-02-10 13:37

    This should work

    SELECT ... FROM SOMETABLE WHERE COLUMN = NVL( INPUT_PARAM, COLUMN )
    

提交回复
热议问题