row_number example
WITH cte_customers AS (
SELECT
ROW_NUMBER() OVER(
ORDER BY
first_name,
last_name
) row_num,
customer_id,
first_name,
last_name
FROM
sales.customers
) SELECT
customer_id,
first_name,
last_name
FROM
cte_customers
WHERE
row_num > 20 AND
row_num <= 30;
Code language: SQL (Structured Query Language) (sql)