Oracle PL\SQL Null Input Parameter WHERE condition

前端 未结 2 1349
感动是毒
感动是毒 2021-02-10 07:45

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 07:58

    This should work

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

提交回复
热议问题