2011年3月9日
摘要: 通过sql语句递归查找所有下级或上级用户1.MS Sqlwith cte as( select Id,Pid,DeptName,0 as lvl from Department where Id = 2 union all select d.Id,d.Pid,d.DeptName,lvl+1 from cte c inner join Department d on c.Id = d.Pid)select * from cte2.Oracle 一、建表 CREATE TABLE USERS.TBL_TEST ( ID NUMBER, NAME VARCHAR2(100 BYTE), PID N 阅读全文
posted @ 2011-03-09 18:25 snowolf 阅读(1358) 评论(0) 推荐(0) 编辑
摘要: SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGO-- =============================================-- Author: cxw-- Create date: 2006/11/14-- Description: 利用Row_Number函数实现分页存储过程-- exec DividePageForROW_NUMBER 2,1,'',''-- =============================================Create PROCEDURE DivideP 阅读全文
posted @ 2011-03-09 15:43 snowolf 阅读(228) 评论(0) 推荐(0) 编辑