Click here to Skip to main content
15,898,371 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a lot of data in table. like this
No ID
1 001
2 001
3 001
1 002
3 002
4 002
5 002

I want to 3 consecutive data by No filed and by group of ID. like this
No ID
1 001
2 001
3 001
3 002
4 002
5 002
so how to write SQL statement for this problem.
Posted

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900