一个二叉树的递归,找出左边最下面的一个点
id 自动编号
pid 父ID
id_path 节点路径
flg 位置,0左边,1右边
ALTER PROCEDURE [dbo].[get_class]
@class int,
其实只需一个查询语句就能找出最下面的ID
节点路径包函1,并且父节点位置都是左边,取出最大一个
select top 1 * from class a where id_path like '%1,%' and flg=0 and (select flg from class where id=a.pid)=0 order by id desc
id 自动编号
pid 父ID
id_path 节点路径
flg 位置,0左边,1右边
ALTER PROCEDURE [dbo].[get_class]
其实只需一个查询语句就能找出最下面的ID
节点路径包函1,并且父节点位置都是左边,取出最大一个
select top 1 * from class a where id_path like '%1,%' and flg=0 and (select flg from class where id=a.pid)=0 order by id desc









