Case Statement Issue
798631Sep 15 2011 — edited Sep 16 2011Hi All,
I need help figuring out a simple case statement. I need to add an OR condition to a couple of the statements and also have a condition that will return everyting. The first query works but lacks the OR condtion/statement. Any help is appreciated.
Select item_no
from item
where item_id =
case
when &p_item = '123' then '123'
when &p_item = '133' then '133'
when &p_item = '444' then '444'
end
How can i do the following?
Select item_no
from item
where item_id =
case
when &p_item = '123' then '123' or null
when &p_item = '133' then '133' or null
when &p_item = '444' then '444'
when &p_item = '999' then return all records
end