how can we return multiple values if a condition is satisfy for ex we can't create or edit the existing table
table= ITEMS
ITEM |. TYPE
------------------------------------------
apple, | fruit
onion, | vegetable
mango |fruit
apple |edible |
mango | edible
onion |edible
select case when item IN ('apple','mango') then ('fruit')
when item IN ('onion') then ('vegetable')
when team In ('apple','mango','onion') then ('edable')
end
from ITEAMS
where item='apple'
output
fruit edible
AS apple is a fruit and edible please advice how could I achieve this in oracle sql thanks in advance
Based on this example:
You could get the output you are looking for with this query:
But you might consider redesigning the table so that you don't have different types of attributes (edible vs fruit) stored in the same column.