-->Title:Generating test data -->Author:wufeng4552 -->Date :2009-09-30 08:52:38 set nocount on if object_id('tb','U')is not null drop table tb go create table tb(ID int, ParentID int) , , , , , , , -->Title:查找指定節點下的子結點 if object_id('Uf_GetChil
//1.删除TreeView节点以及其子节点procedure TForm2.Button1Click(Sender: TObject);var TreeNode:TTreeNode;begin if TreeView1.Selected <> Nil then Begin TreeNode := TreeView1.Selected.getFirstChild; while TreeNode <> nil do begin TreeNode.Del
编写了一个遍历一个目录下所有的文件及文件夹,然后计算每个文件的字符和line的小程序,先把程序贴出来. #coding=utf-8 ''' Created on 2014年7月14日 @author: Administrator ''' import os import os.path rootdir =r'c:\python27\jiaoben' filefullnames=[] def traverse(rootdir,filefullnames): for parent,dirnames,
原文:在论坛中出现的比较难的sql问题:21(递归问题 检索某个节点下所有叶子节点) 最近,在论坛中,遇到了不少比较难的sql问题,虽然自己都能解决,但发现过几天后,就记不起来了,也忘记解决的方法了. 所以,觉得有必要记录下来,这样以后再次碰到这类问题,也能从中获取解答的思路. 问题:求SQL:检索某个节点下所有叶子节点 部门表名:tb_department id int --节点id pid int --父节点id caption varchar
根据id查询父节点,具体需要修改的地方笔者已在注释中给大家作了注解 DELIMITER $$ USE `yjlc_platform`$$ -- getCompanyParent 为函数名 DROP FUNCTION IF EXISTS `getCompanyParent`$$ -- getCompanyParent 为函数名 rootId为参数,可以自定义:初学者可以不用更改 )) ) CHARSET utf8 BEGIN ); ); SET ptemp = '#'; SET ctemp = r