Top "Group-by" questions

GROUP BY is a command in the SQL relational database standard for collapsing a group of rows that share common field value(s) into a single row.

Grouping into interval of 5 minutes within a time range

I have some difficulties with mySQL commands that I want to do. SELECT a.timestamp, name, count(b.name) FROM …

mysql sql group-by
GROUP BY without aggregate function

I am trying to understand GROUP BY (new to oracle dbms) without aggregate function. How does it operate? Here is …

sql oracle group-by aggregate-functions
Using GroupBy, Count and Sum in LINQ Lambda Expressions

I have a collection of boxes with the properties weight, volume and owner. I want to use LINQ to get …

linq count lambda group-by sum
pandas GroupBy columns with NaN (missing) values

I have a DataFrame with many missing values in columns which I wish to groupby: import pandas as pd import …

python pandas group-by pandas-groupby nan
How to select the first row for each group in MySQL?

In C# it would be like this: table .GroupBy(row => row.SomeColumn) .Select(group => group .OrderBy(row => …

mysql group-by grouping
Group by month and year in MySQL

Given a table with a timestamp on each row, how would you format the query to fit into this specific …

sql mysql group-by date
Linq with group by having count

how do I write this query in linq (vb.net)? select B.Name from Company B group by B.Name …

linq count group-by having
MySQL - sum column value(s) based on row from the same table

I'm trying to get 'Cash', 'Check' and 'Credit Card' totals in new columns based on ProductID from the same table. …

mysql select group-by left-join pivot
Renaming Column Names in Pandas Groupby function

Q1) I want to do a groupby, SQL-style aggregation and rename the output column: Example dataset: >>> df …

python pandas group-by pandas-groupby rename
mysql count group by having

I have this table: Movies (ID, Genre) A movie can have multiple genres, so an ID is not specific to …

mysql sql group-by aggregate-functions