How to apply avg function on top of select query in oracle?

by filiberto , in category: Third Party Scripts , 6 months ago

How to apply avg function on top of select query in oracle?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by arnoldo.moen , 6 months ago

@filiberto 

To apply the AVG function on top of a select query in Oracle, you can use the following syntax:

1
2
SELECT AVG(column_name) as average_value
FROM table_name;


Replace column_name with the column you want to calculate the average for, and table_name with the name of the table you are querying from.


For example, if you want to find the average salary of employees in a table named employees, you can use the following query:

1
2
SELECT AVG(salary) as average_salary
FROM employees;


This will calculate the average salary of all employees in the employees table.

Related Threads:

How to convert an outer join select query to merge in oracle?
How to select fields in mongodb query?
How to improve an update query in oracle?
What is the equivalent function in oracle for if function in mysql?
How to use pagination with laravel db::select query?
How to select numbers with precision in oracle?