Averaging rows in Oracle Query Builder [message #374955] |
Fri, 13 July 2001 11:49 |
ewreliant
Messages: 1 Registered: July 2001
|
Junior Member |
|
|
I am trying to average rows in 6 row intervals using the AVG(ALL num) function in another column.
How do I write this function. I don't understand what DISTINCT|ALL means and what I put in there
|
|
|
Re: Averaging rows in Oracle Query Builder [message #374958 is a reply to message #374955] |
Fri, 13 July 2001 15:24 |
Sudhakar Atmakuru
Messages: 58 Registered: May 2001
|
Member |
|
|
It is a syntax for AVG group function, using which you can average distinct (unique) values of column or all (including duplicates) values of column.
For ex:
SELECT AVG(TOT) FROM table_name;
It averages the values of TOT column which may have duplicates in it. If I want to average only the unique totals (eliminating the duplicates) of it, then i should give
SELECT AVG(DISTINCT TOT) FROM table_name;
For row intervals, you could use ROWID in SQL.
Hope this helps.
|
|
|