第一条: Select Top 1 .... 第二条: Select Top 1 * from tablename where id not in (select top 1 id form tablename) 第三条: Select Top 1 * from tablename where id not in (select top 2 id form tablename) 最后一条 Select * from tablename where id not in (select Top Count(*) -1 id form tablename) 最后第二条 Select * from tablename where (id not in (select Top Count(*) -2 id form tablename)) and (得到最后一条)) 最后第三条 Select * from tablename where (id not in (select Top Count(*) -2 id form tablename)) and (得到最后第二条)) ____________________________________________________________________________暮春三月,羊欢草长,天寒地冻,问谁饲狼?人心怜羊,狼心独怆,天心难测,世情如霜…… {言有尽而意无穷,余意尽在不言中……} ____________________________________________________________________________
Select Top 1 ....
第二条:
Select Top 1 * from tablename where id not in (select top 1 id form tablename)
第三条:
Select Top 1 * from tablename where id not in (select top 2 id form tablename)
最后一条
Select * from tablename where id not in (select Top Count(*) -1 id form tablename)
最后第二条 Select * from tablename where (id not in (select Top Count(*) -2 id form tablename)) and (得到最后一条))
最后第三条
Select * from tablename where (id not in (select Top Count(*) -2 id form tablename)) and (得到最后第二条))
____________________________________________________________________________暮春三月,羊欢草长,天寒地冻,问谁饲狼?人心怜羊,狼心独怆,天心难测,世情如霜……
{言有尽而意无穷,余意尽在不言中……}
____________________________________________________________________________
不知道行哇.
一种方式是用存储过程,如上边的那个,最好先获得count
另一种方式就是先获得数据到临时表之中,才到CDS中//中有CDS才可以具有你的这种功能,数据提过来,但是可以操作
_____________________________________________________________________暮春三月,羊欢草长,天寒地冻,问谁饲狼?人心怜羊,狼心独怆,天心难测,世情如
霜……{言有尽而意无穷,余意尽在不言中……}