SQL – How to use GROUP BY

Here’s an example of how to use GROUP BY in a SQL query: This produces the following query results: GROUP BY allows you to group rows based on one or more columns and calculate aggregate values for the group. In the example above, the COUNT(*) aggregate function was used to show the number of rows … Read more

EF Core – Aggregate SELECT queries

In this article, I’ll show how to use EF Core to aggregate data for the whole table, per group, and how to only include groups that meet a condition. I’ll show three different aggregates – count, sum, and average. In each scenario, I’ll show the LINQ query, the SQL query it generated, and the results … Read more