如何将下列语句转化成SQL SERVER
with c(temp_qybm,qybm,sjqy) as
(select qybm,qybm,(case when ((sjqy is null) or (sjqy='')) then qybm else sjqy end) from t_qy where
qybm in (select qybm from t_jgxx)
union all
select c.temp_qybm,t.qybm,t.sjqy from t_qy t,c where
c.qybm=t.sjqy)
select temp_qybm,qybm,cast(0 as integer) from c
|