This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revision Both sides next revision | ||
kurs:connect_by_prior [2012/09/25 17:22] 127.0.0.1 external edit |
kurs:connect_by_prior [2012/10/04 14:57] mh |
||
---|---|---|---|
Line 44: | Line 44: | ||
group by jahr | group by jahr | ||
order by jahr | order by jahr | ||
+ | </code> | ||
+ | |||
+ | <code> | ||
+ | select prior salary - salary, salary, last_name from ( | ||
+ | select rownum rn, last_name, salary from ( | ||
+ | select last_name, salary from employees order by salary desc | ||
+ | ) | ||
+ | ) connect by prior rn = rn-1 | ||
+ | start with rn = 1 | ||
</code> | </code> |