Reputation: 41
How can I query a Hive table specific to row number.
For example :
Let say I want to print out all records of Hive table from row number 2 to 5.
Upvotes: 0
Views: 5437
Reputation: 44921
I actually recently updated the documentation regarding the offset option
... order by ... limit 1,4
Upvotes: 1
Reputation: 1738
This answer seems like what you're asking:
SQL most recent using row_number() over partition
In other words:
SELECT user_id, page_name, recent_click
FROM (
SELECT user_id,
page_name,
row_number() over (partition by session_id order by ts desc) as recent_click
from clicks_data
) T
WHERE recent_click between 2 and 5
Upvotes: 0