摘要: 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... 阅读全文
posted @ 2014-03-27 19:05 kedarui 阅读(288) 评论(0) 推荐(0) 编辑
摘要: --Description: 字符处理 --使用: 放到查询分析器里执行就可以了 --示例: select * from dbo.splitstr('12 44 45 50 56 87',' ') order by F1 asc --ALTER function splitstr(@SourceSql varchar(8000),@StrSeprate varchar(5)) create function [dbo].[splitstr2](@SourceSql varchar(8000),@StrSeprate varchar(5)) returns @te 阅读全文
posted @ 2014-03-27 14:59 kedarui 阅读(158) 评论(0) 推荐(0) 编辑