唐三最后娶了谁
吴谨言整容前后照片sqlserver⽗⼦层次查询
WITH DeptTree
as
(
蒋勤勤和刘涛怎么了select  No,Name,parentNo,0 as Level,cast('0' as nvarchar(max)) as treepath from Port_Dept where No = '100'
union all
select d.No,d.Name,d.parentNo,tr.[Level] + path + [dbo].[Lpad](Row_Number() over (order by tr.No desc),8) as treepath from Port_Dept as d
inner join DeptTree as tr on d.parentNo = tr.No )
SELECT No,replicate(' ',Level*3)+Name as Name,treepath from DeptTree order by treepath
野蛮游戏mv--左端补指定数量字符
create FUNCTION dbo.Lpad
(
@i int,@len int
相思扣)
RETURNS nvarchar(max)
AS
BEGIN
不哭侯旭
RETURN cast (replicate('0', @len - len(@i) ) + convert(nvarchar,@i) as nvarchar(max))