醉清风2

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

在 05 中 有个RowNumber() 函数

select Row_Number() over(order by MebID) as 自动增长列, from m_main

用法如上

Row_Number() over ( order by 排序的字段) 通过这个

上面的方法很好用

在介绍给方法,这是一个朋友教给我的

select (select count(pointid) from m_Point as A where A.pointid<=B.pointid) as 自动增长列 from m_Point as B

这个方法通过查找时 每次显示出现有的数量 效果和自增量一样

posted on 2013-11-08 20:58  醉清风2  阅读(259)  评论(0编辑  收藏  举报