select (select count(1) from ocrd where cardcode >T0.cardcode ) as primaryid,* from ocrd T0 order by (select count(1) from ocrd where cardcode >T0.cardcode ) --> order by 1 就可以了. select (select count(1) from ocrd where cardcode >T0.cardcode ) as primaryid,* from ocrd T0 order by 1 PS: 临时表,或者表变量可以不? select identity(int,1,1) as id ,* into #temp from from ocrd order by 1
order by (select count(1) from ocrd where cardcode >T0.cardcode )
--> order by 1 就可以了.
select (select count(1) from ocrd where cardcode >T0.cardcode ) as primaryid,* from ocrd T0
order by 1 PS:
临时表,或者表变量可以不?
select identity(int,1,1) as id ,* into #temp from from ocrd order by 1
..我在sql2K里面的,有什么好办法吗?
谢谢你的回复
我是想通过sql语句 一次性在前台显示