;with catChild as(select *,cast(right(''+cast(Sort as varchar),5) as varchar(max)) as ssort
from Category where ID = '123'
union all select t.*,
cast(ssort+right(''+cast(t.Sort as varchar),5) as varchar(max))
from catChild, Category t
where catChild.ID = t.ParentID)
select * from catChild where IsVolumes='' order by ssort,Sort ;with cte as
(select ID,Name,ParentID,1 level,
cast(right(''+cast(Sort as varchar),5) as varchar(max)) as ssort
from Category where ID = '111A'
union all select t.ID,t.Name,t.ParentID,c.level + 1,
cast(ssort+right(''+cast(t.Sort as varchar),5) as varchar(max))
from Category t
join cte c on t.ParentID = c.ID)
select ID, Name, ParentID, level,ssort
from cte order by ssort

最新文章

  1. CTO干点啥?
  2. 实战之中兴ZXHN F460光猫破解超级密码+开启无线路由功能
  3. ECMAScript —— 学习笔记(思维导图版)
  4. 基于SocketAsyncEventArgs的版本
  5. Linux Bash命令关于程序调试详解
  6. Benefits of Cold Showers: 7 Reasons Why Taking Cool Showers Is Good For Your Health
  7. 卷积神经网络 cnnff.m程序 中的前向传播算法 数据 分步解析
  8. android 简单的开机自启
  9. iOS开发 改变UINavigationController的UINavigationBar的高度和背景图片
  10. solrCloud设置Tomcat jvm内存解决内存溢出的问题
  11. JS的if和switch
  12. R画网络图
  13. python之做一个简易的翻译器(二)
  14. [原]Jenkins(二十一) jenkins再出发Build periodically和Poll SCM
  15. 学JS的心路历程Day28 - PixiJS -基础(二)
  16. tomcat+bean例子
  17. A-Softmax的总结及与L-Softmax的对比——SphereFace
  18. ASP.NET的内置对象 —— Request 对象
  19. SQLInjection 靶场配置
  20. Azure Nosql

热门文章

  1. web 给大家分享一个好玩的东西,也许你那块就用的到
  2. ASP.NET MVC学习目录
  3. WPF圆角按钮
  4. python中的基本数据类型(int,bool,str)及字符串操作
  5. Eclipse导出JAR过程
  6. 深浅copy和浅copy
  7. 2018-2019-2 网络对抗技术 20165219 Exp3 免杀原理与实践
  8. “全栈2019”Java多线程第十章:Thread.State线程状态详解
  9. Python(序列化json,pickle,shelve)
  10. jenkins+gitlab+robot framework 中遇到的坑