Menu

12 Eylül 2010 Pazar

AVG

AVG(DISTINCT|ALL
) fonksiyonunda p sayisal bir ifadedir. AVG fonksiyonu aritmetik ortalamayi verir. Eger DISTINCT yada ALL kullanilmaz ise varsayilan degeri ALL`dir.

SELECT department_id, AVG(salary) FROM employees
      GROUP BY department_id
      ORDER BY AVG(salary)



DEPARTMENT_ID          AVG(SALARY)           
---------------------- ----------------------
50                     4625.964444444444444444444444444444444444
30                     5523.65               
10                     5856.4                
60                     7666.56               
20                     7986                  
40                     8651.5                
                          9317                  
100                    11448.375             
80                     11920.2794117647058823529411764705882353
70                     13310                 
110                    13514.975             
90                     25732.6666666666666666666666666666666667

12 rows selected

Hiç yorum yok:

Yorum Gönder