急,请各位高手们帮忙. 必须先生成一个连续的ID才行. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 例如:按cnt从小到大。--sql 2000select * , px = (select count(1) from tb where cnt < t.cnt) + 1 from tb t--sql 2005select * , px = row_number() over(order by cnt) from tb然后对上面的查询做子查询来查。--sql 2000select * from( select * , px = (select count(1) from tb where cnt < t.cnt) + 1 from tb t) m where px = 1 --2,3,4--sql 2005select * from ( select * , px = row_number() over(order by cnt) from tb) mwhere px = 1 --2,3,4 求下列分组统计的语句 SQL行列转换合计问题!望各位多多指教!100分!分不多别见怪! 求用 SQL 语法的实现 类似 VB format 函数的过程 来CSDN整整两个月,散分 菜鸟提问 怎样使繁体中文插入简体SQL Server数据库后不会变成乱码? 一个数据库问题? 请问如何将三个表同过各自两个字段实现两两外连接啊? SSIS耗尽内存 求一个订单号生成问题 分不多大家帮忙 DBA笔试题疑问 当字段为数字
select * , px = (select count(1) from tb where cnt < t.cnt) + 1 from tb t--sql 2005
select * , px = row_number() over(order by cnt) from tb然后对上面的查询做子查询来查。
--sql 2000
select * from
(
select * , px = (select count(1) from tb where cnt < t.cnt) + 1 from tb t
) m
where px = 1 --2,3,4--sql 2005
select * from
(
select * , px = row_number() over(order by cnt) from tb
) m
where px = 1 --2,3,4