如何在 Oracle 9i 中的 where 条件中使用计算列?

我想使用类似的东西

select decode (:pValue,1,
               select sysdate from dual,
               select activation_date from account where AcNo = 1234) as calDate
where caldate between startDate and endDate;

最佳答案

您可以使用内嵌 View :

select calcdate from
(
select startDate, endDate,
       decode (:pValue,1,
               select sysdate from dual,
               select activation_date from account where AcNo = 1234) as calcdate
)
where calcdate between startDate and endDate;

关于sql - 如何在 where 条件下使用计算列?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/2416522/

10-11 03:27
查看更多