日期:2014-05-17 浏览次数:20524 次
select *,row_number() over(partition by 号码 order by 时间 asc) as 次数 from TB ------解决方案--------------------方法2,
select a.*, (select count(1) from [表名] b where b.号码=a.号码 and b.时间<=a.时间) '次数' from [表名] a