If one of the paramater is passed / or both passed how to match that to single column in WHERE clause.
If both are passed should get result set just with the first one else with second one.
Ex:
--either will be passed
declare @processStepID int = null
declare @PROCESS_StepID int = null
if(@processStepID is null)
select * from CTL.CTRL.CTRL_PROCESS_STEP_ACTIVITIES
where PROCESS_STEP_ID = @PROCESS_StepID
else
select * from CTL.CTRL.CTRL_PROCESS_STEP_ACTIVITIES
where PROCESS_STEP_ID = @processStepID
How can this be written in where clause not using if statement.
thanks