Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- 1. We want to reward out users who have been around the longest. Find the 5 oldest users.
- SELECT * FROM
- (
- SELECT *,
- DENSE_RANK() OVER(ORDER BY created_at) AS time_dense_rank
- FROM users
- ) AS A
- WHERE time_dense_rank BETWEEN 1 AND 5;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement