自行排序,然后在求差。 select 分数 from( select 分数, row_number()over() as py, row_number()over(order by 分数 ) as pn from 成绩表 ) as t group by t.分数,cast(py as signed)-cast(pn as signed) having count(t.分数)>=3
自行排序,然后在求差。 select 分数 from( select 分数, row_number()over() as py, row_number()over(order by 分数 ) as pn from 成绩表 ) as t group by t.分数,cast(py as signed)-cast(pn as signed) having count(t.分数)>=3