树形数据显示SQL示例代码(在ms sql 2000 DBMS中调试通过)

80酷酷网    80kuku.com

  示例|数据|显示树形数据显示SQL示例代码(在ms sql 2000 DBMS中调试通过)

SELECT DeptCode1 + DeptCode2 + DeptCode3 AS dpcode,
      CASE WHEN deptname2 = '' THEN deptname1 WHEN deptname2 <> '' AND
      deptname3 = '' THEN DeptName1 + '\' + DeptName2 WHEN deptname2 <> '' AND
      deptname3 <> '' THEN DeptName1 + '\' + DeptName2 + '\' + DeptName3 END AS dpname
FROM dbo.Department
















分享到
  • 微信分享
  • 新浪微博
  • QQ好友
  • QQ空间
点击: