About 6,740,000 results
Open links in new tab
  1. mysql - SQL query with avg and group by - Stack Overflow

    MySQL query to receive above results: SELECT AVG(amount) AS AVG_rows_sensor FROM DW GROUP BY sensor_id;

  2. mysql - Getting the average in a GROUP BY statement - Stack Overflow

    May 17, 2018 · If you want the average grouped by a field, you can use group by. Imagine you want the avegare age grouped by gender: SELECT AVG(age) as average_age, gender FROM …

  3. mysql - Getting the average price of products in a category

    You will likely need to use GROUP BY clause when using an aggregate function. Here is an example straight from the manual using the AVG function: …

  4. How to Calculate Averages with GROUP BY in MySQL

    In this guide, we'll explore how to use the GROUP BY clause to calculate averages in MySQL. The basic syntax for calculating averages with GROUP BY in MySQL is as follows: SELECT …

  5. SQL AVG() Function - W3Schools

    Here we use the AVG() function and the GROUP BY clause, to return the average price for each category in the Products table: Example SELECT AVG(Price) AS AveragePrice, CategoryID

  6. MySQL GROUP BY Statement - W3Schools

    The GROUP BY statement groups rows that have the same values into summary rows, like "find the number of customers in each country". The GROUP BY statement is often used with …

  7. MySQL AVG() Function - MySQL Tutorial

    For example, to calculate the average buy price of products for each product line, you use the AVG() function with the GROUP BY clause as the following query: SELECT productline, AVG …

  8. Calculating the AVG value per GROUP in the GROUP BY Clause

    Oct 7, 2015 · SELECT DATEPART(HOUR, CallTime) AS Hour, (AVG(calls.WaitDuration) / 60) AS WaitingTimesInMinutes FROM ( SELECT CallTime, WaitDuration FROM Calls WHERE …

  9. How to Write an SQL Query to Calculate the Average Price of ...

    Jan 10, 2025 · The AVG() function provides a straightforward and efficient way to calculate the average price of products in SQL. By combining it with clauses like GROUP BY and WHERE , …

  10. MySQL 8: Find the sum/average of values in each group

    Jan 26, 2024 · In this tutorial, we will explore how to apply these aggregation functions in MySQL 8 using the SUM() and AVG() functions with the GROUP BY clause. By the end of this guide, …

  11. Some results have been removed
Refresh