I want to know, how can i select next 4 consecutive rows along with the resultant row in MySQL?
To explain:-
i have following rows in table abc
name | amount
a - 1000
b - 2000
c - 3000
d - 4000
e - 5000
f - 6000
Now,
if my selection criteria is name = a , then resultant rows returned should be
a - 1000
b - 2000
c - 3000
d - 4000
e - 5000
In other words i want a query which will return result of query – “select * from abc where name = ‘a'” plus next 4 consecutive rows to that row?
1 Answer