0
在Oracle sql中,我想從表中選擇幾列值。如果沒有行存在,我想爲每列選擇默認值。我需要類似下面的東西如果存在行,則選擇列else oracle中的默認值
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中這樣做的最好方法是什麼?