then 的 后面可以接sql 语句吗?
如:
when t_ProPrice = 1 then (select MaxValue from I_PriceDictionary where ID in (select t_ProPrice from T_Subscription where TID=123)
可以,不过我估计是你case when的地方放错了,你借鉴下以下例子呢:
create table t1(id int);
insert into t1 values(1);
create table t2(id int);
insert into t2 values(3);
select case id when 1 then(select id from t2) end from t1;