【发布时间】:2017-01-27 18:15:51
【问题描述】:
在 Oracle sql 中,我想从表中选择几个列值。如果不存在行,我想为每列选择默认值。我需要类似下面的东西
if exists (select 1 from mytable where key ='11')
then
select key, value, comment from mytable where key ='11'
else
select 'key1' as "key", 'value1' as "value", 'default' as "comment"
在 oracle 中执行此操作的最佳方法是什么。
【问题讨论】: