How to query the front and back n rows of a piece of random row in hive

Viewed 13

After selecting a random row, I want to be able to select n number of records preceding and following it. example:

id  content
1    add 
2    bob
3    cdf
4    asd

random row id is 3,i need select result:

2    bob
3    cdf
4    asd
0 Answers
Related