Oracle function: row_number()
1.
select *
from (select *
from (select t.*, row_number() OVER(ORDER BY null) AS "row_number"
from twitter_accounts t) p
where p."row_number" > 0 and p."row_number" <=2) q
where rownum <= 10
2.
select *
from (select *
from (select t.*, row_number() OVER(ORDER BY null) AS "row_number"
from twitter_accounts t) p
where p."row_number" > 0 and p."row_number" <=2) q
where rownum <= 10
2.
SELECT department_id, last_name, employee_id, ROW_NUMBER() OVER (PARTITION BY department_id ORDER BY employee_id) AS emp_id FROM employees;
3.
SELECT last_name FROM (SELECT last_name, ROW_NUMBER() over (order by last_name) R FROM employees) WHERE R BETWEEN 51 and 100;
评论
发表评论