sql - CASE statement in WHERE clause -


I have a process in which the following condition is to be written in the WHERE section I How do I do this, or something like using the case ?

  if (@ ITMID is not) data ID = @timid  

You do not need a case for this:

  ... where @ ItemId is blank or data id = @ ITMID ...  

Or:

  ... where isnull (@itemId, dataId) = dataId ...  

Comments