摘要:
with CTE as ( -->Begin 一个定位点成员 select ID, PersonName,ParentID,cast(PersonName as nvarchar(max)) as TE, ROW_NUMBER()over(order by getdate()) as OrderID --最关键是上面这个字段,要获取排序字段,按字符串来排序。 --其中窗口函数必须要使用order by,但是不能用整型,那就用时间吧 from tmpTPStmp where ParentID=0-->End... 阅读全文