一个用SQL实现数据排列的问题
最近公司的一个业务需要使用SQL完成对数据的排列,具体要求如下:
存储过程实现,只能有一个参数(一页显示的数据行数)。当参数为1的时候,数据排列为:
1 2 3
当参数为2的时候:
1 3 5
2 4 6
参数为3的时候:
1 4 7
2 5 8
3 6 9
一直没有找到合适的方法来处理,希望大家能给点建议,谢谢
He deals the cards as a meditation
And those he plays never suspect
He doesn't play for the money he wins
He doesn't play for the respect
He deals the cards to find the answer
And those he plays never suspect
He doesn't play for the money he wins
He doesn't play for the respect
He deals the cards to find the answer