SQL SERVER树型数据展示
来源:互联网 发布:淘宝收货地址默认地址 编辑:程序博客网 时间:2024/05/16 08:05
--得到指定objectid的子id列表
CREATE function DBO.f_getchildid(@id nvarchar(40))
returns @re table(objectid nvarchar(40))
as
begin
insert into @re select objectid from account where parent_objectid=@id
while @@rowcount>0
insert into @re select a.objectid
from account a inner join @re b on a.parent_objectid=b.objectid
where a.objectid not in(select objectid from @re)
return
end
--得到指定objectid的父ID列表
CREATE function DBO.f_getparentid(@id nvarchar(40))
returns @re table(objectid nvarchar(40))
as
begin
declare @pid nvarchar(40)
select @pid=parent_objectid from account where objectid=@id
while @pid<>@id
begin
insert into @re values(@pid)
select @pid=parent_objectid,@id=objectid from account where objectid=@pid
end
return
end
- SQL SERVER树型数据展示
- sql语句随机展示数据
- MS SQL Server树型结构数据显示的SQL语句(纯SQL语句,不用函数)
- SQL Server 数据平台
- SQL server 导入数据
- Sql Server数据同步
- SQL Server数据完整性
- Excel数据 SQL SERVER
- SQL Server 数据转换
- SQL server--数据安全
- SQL Server数据完整性
- SQL Server数据完整性
- Sql Server 数据分页
- Sql Server 数据分页
- Sql Server 数据分页
- Sql Server 数据分页
- Sql Server 数据分页
- Sql Server 数据分页
- Shark流程跳转的设计
- 字符型转为32位数字型
- 汇总c#.net常用函数和方法集
- ToString()的格式
- 字符串长度
- SQL SERVER树型数据展示
- 打开,另存为,属性,打印等14个JS代码
- 别给自己戴上望远镜
- 截取字串的一部分
- 取得IP
- 清除前后的空格
- JS验证
- 替换字符
- .NET环境下水晶报表使用总结