【发布时间】:2020-08-30 00:17:00
【问题描述】:
我必须根据传入变量的值从单个表中返回不同的列。
我尝试过使用 case 语句,但没有成功。有没有办法实现这个逻辑?
select
case
when :var1='A1' then (select variable,value1,value2 from table where variable='A1')
when :var1='A2' then (select variable,value3,value4 from table where variable='A2')
end
from dual;
【问题讨论】:
标签: oracle plsql oracle-sqldeveloper