oracle, rownum, ROW_NUMBER vs ROWNUM

http://explainextended.com/2009/05/06/oracle-row_number-vs-rownum/

 

–1 wpis
SELECT kolumna1,kolumna2
FROM
(SELECT kolumna1,kolumna2,kolumna3, row_number() OVER (ORDER BY kolumna1 desc) as rnum FROM NAZWA_TABELKI where kolumna3=’JAKAS_WARTOSC’)
WHERE
rnum between 1 and 1;

–3 wpisy
SELECT kolumna1,kolumna2
FROM
(SELECT kolumna1,kolumna2,kolumna3, row_number() OVER (ORDER BY kolumna1 desc) as rnum FROM NAZWA_TABELKI where kolumna3=’JAKAS_WARTOSC’)
WHERE
rnum between 1 and 3;