Quantcast
Channel: Database Journal
Viewing all articles
Browse latest Browse all 151

Pivot Aggregate Counts on Months in MySQL

$
0
0

A cross tabulation query is used to display the result of an aggregation on two or more fields. The trick to this type of query is the transformation of rows of data to columns. Follow along with Rob Gravelle as he creates a crosstab query for the Sakila sample database that counts the number of movie rentals for each customer aggregated by month.


Viewing all articles
Browse latest Browse all 151

Trending Articles