SELECT CUME_DIST(1, .02) WITHIN GROUP
   (ORDER BY Kolumna1, Kolumna2) 
   FROM MojaTabela;

SELECT DENSE_RANK(1, .03) WITHIN GROUP 
   (ORDER BY Kolumna1 DESC,Kolumna2) 
   FROM MojaTabela;

SELECT Kolumna1,
MIN(Kolumna2) KEEP (DENSE_RANK FIRST ORDER BY Kolumna1)
MAX(Kolumna3) KEEP (DENSE_RANK LAST ORDER BY Kolumna1)
   FROM MojaTabela
   GROUP BY Kolumna1;

SELECT Kolumna1, Kolumna2,
   SUM(Kolumna3),
   GROUP_ID() 
FROM MojaTabela
GROUP BY Kolumna1,
   ROLLUP (Kolumna1, Kolumna2);

SELECT GROUPING(Kolumna1),
   COUNT(*) , AVG(Kolumna2)
   FROM MojaTabela
   GROUP BY ROLLUP (Kolumna1);

SELECT Kolumna1, Kolumna2, SUM(Kolumna3) Suma
FROM MojaTabela
GROUP BY Kolumna1, Kolumna2
WITH ROLLUP;

SELECT Kolumna1, Kolumna2, sum(Kolumna3),
GROUPING(Kolumna1),
GROUPING(Kolumna2),
GROUPING_ID(Kolumna1, Kolumna2),
GROUPING_ID(Kolumna2, Kolumna1)
FROM MojaTabela
GROUP BY CUBE(Kolumna1, Kolumna2);
 
SELECT Kolumna1, PERCENTILE_CONT(0.5) 
WITHIN GROUP (ORDER BY Kolumna2 DESC)
FROM MojaTabela
GROUP BY Kolumna1;

SELECT Kolumna1, PERCENTILE_DISC(0.5) 
WITHIN GROUP (ORDER BY Kolumna2 DESC)
FROM MojaTabela
GROUP BY Kolumna1;

SELECT PERCENT_RANK(1, .01) WITHIN GROUP
   (ORDER BY Kolumna1, Kolumna2)  
   FROM MojaTabela;

SELECT RANK(1, .01) WITHIN GROUP
   (ORDER BY Kolumna1, Kolumna2) 
   FROM MojaTabela;


SELECT
Kolumna3,
REGR_SLOPE(Kolunn1, Kolumna2),
REGR_INTERCEPT(Kolunn1, Kolumna2),
REGR_R2(Kolunn1, Kolumna2),
REGR_COUNT(Kolunn1, Kolumna2),
REGR_AVGX(Kolunn1, Kolumna2),
REGR_AVGY(Kolunn1, Kolumna2)
FROM MojaTabela
GROUP BY Kolumna3;
