DB2 转化成SQL SERVER

[复制链接]
查看11 | 回复2 | 2005-10-30 17:05:33 | 显示全部楼层 |阅读模式
如何将下列语句转化成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
回复

使用道具 举报

千问 | 2005-10-30 17:05:33 | 显示全部楼层
有高手知道怎么做吗
回复

使用道具 举报

千问 | 2005-10-30 17:05:33 | 显示全部楼层
select qybm,qybm,(case when ((sjqy is null) or (sjqy='')) then qybm else sjqy end) into c
from t_qy where qybm in (select qybm from t_jgxx)
select * from c
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
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行