请教下面这种情况如何写SQL语句

请问下面这种情况怎么写SQL语句?
这样的表:
ID 前一记录的ID
——————————————
1  
2  
3 1
4 3
5 2
6 4


比如我给定了查询ID为6,那么可以列出的记录是1、3、4、6,等于是把这一串记录都列出来了,这用SQL查询应该怎么实现呢?

------解决方案--------------------
你参考这两个方法吧,我这里没有环境没有办法测试


方法一:


if object_id('tbDepartment') is not null
drop table tbDepartment
if object_id('fnGetFather') is not null
drop function fnGetFather
GO
create table tbDepartment(ThisID varchar(50),ParentID varchar(50),Name varchar(100),Depth int)
insert tbDepartment
select 1,0,'a',1 union all
select 2,0,'b',1 union all
select 3,1,'c',2 union all
select 4,3,'d',3 union all
select 5,2,'e',2 
GO
----创建函数
create function fnGetFather(@id varchar(50))
returns @t table(ThisID varchar(50),ParentID varchar(50),Name varchar(100),Depth int)
as
begin
select @id = ParentID from tbDepartment where ThisID = @id
while @@rowcount > 0
begin
insert into @t select * from tbDepartment where ThisID = @id
select @id = ParentID from tbDepartment where ThisID = @id
end
return 
end
GO

----查询
select * from dbo.fnGetFather(4) order by 1 --DESC

----清除测试环境
drop table tbDepartment
drop function fnGetFather

/*结果
ThisID ParentID Name Depth
------------------------------------
1 0 a 1
3 1 c 2
*/


--------------------
方法二:


----创建测试数据
if object_id('tbTest') is not null
drop table tbTest
if object_id('fnGetFather') is not null
drop function fnGetFather
GO
create table tbTest(AdminPart_Id int,AdminPart_Name varchar(20),AdminPart_UpId int)
insert tbTest
select 6, '分站管理员', 11 union all
select 11, '超级管理员', 0 union all 
select 12, '北京分站管理员', 6 union all
select 13, '上海分站管理员', 6 union all
select 14, '北京新闻频道管理员', 12 union all
select 15, '上海新闻频道管理员', 13
GO
----创建函数
create function fnGetFather(@id int)
returns @t table(AdminPart_Id int,AdminPart_Name varchar(20),AdminPart_UpId int)
as
begin
select @id = AdminPart_UpId from tbTest where AdminPart_Id = @id
while @@rowcount > 0
begin
insert into @t select * from tbTest where AdminPart_Id = @id
select @id = AdminPart_UpId from tbTest where AdminPart_Id = @id
end
return 
end
GO

----查询
select AdminPart_Id, AdminPart_Name from dbo.fnGetFather(13) order by 1 DESC

----清除测试环境
drop table tbTest
drop function fnGetFather

/*结果
AdminPart_Id AdminPart_Name
------------ -------------------- 
11 超级管理员
6 分站管理员
*/
------解决方案--------------------
select * from 表 where ID<=(select ID from 表 where ID=6)
union all
select * from 表 where ID=6