摘要: sql查询的时候有时候要加上行号,这里做个备忘~1(建议采用),select row_number() over (order by col1) as no,newid() as id,*from Table1order by col12,select no=identity(int,1,1),newid() as id,* into #temptable From Table1order by col1Select * From #temptableDrop Table #temptable3,SELECT (SELECT sum(1) FROMTable1WHEREcol1 <= a 阅读全文
posted @ 2011-07-12 17:08 tian_z 阅读(21475) 评论(0) 推荐(0) 编辑