This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
kurs:rownum [2013/05/14 11:32] mh |
kurs:rownum [2015/10/27 09:42] (current) mh |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | Verschachtelte with-clause zum "Nachbauen" von limit | ||
| + | |||
| + | <code> | ||
| + | with | ||
| + | emp_sal_sort as ( | ||
| + | select first_name, | ||
| + | last_name, | ||
| + | salary | ||
| + | from employees | ||
| + | order by salary desc | ||
| + | ), | ||
| + | emp_sal_sort_rn as ( | ||
| + | select rownum rn, emp_sal_sort.* from emp_sal_sort | ||
| + | ) | ||
| + | select * from emp_sal_sort_rn | ||
| + | where rn > 10 and rn <= 20 | ||
| + | </code> | ||
| + | |||
| + | |||
| <code> | <code> | ||
| select first_name, last_name, salary from employees where | select first_name, last_name, salary from employees where | ||