加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > MsSql教程 > 正文

在过程中用传来的参数拼串

发布时间:2020-12-12 15:02:04 所属栏目:MsSql教程 来源:网络整理
导读:--case when 嵌套 declare @departmentID int ;with DP (dpid,dpname,dppreid) as ( ? select dpid,DPPreID from CRC_Department_DP dp ? where ('1'= (case when @departmentID0 then '1' ???????????? ?????????????? else case when DPID=@departmentID t

--case when 嵌套

declare @departmentID int

;with DP (dpid,dpname,dppreid)
as
(
? select dpid,DPPreID from CRC_Department_DP dp
? where ('1'= (case when @departmentID<0 then '1'
????????????
?????????????? else case when DPID=@departmentID then '1' else '0' end? end))
? union all
? select a.dpid,a.dpname,a.DPPreID from CRC_Department_DP a inner join
???????? DP b on a.DPPreID = b.DPID
)

?

在sqlserver 中执行的很好? 但是oracle 不支持

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读