Top "Crosstab" questions

A cross tab, also known as a "pivot table", is a method of summarizing data in tabular form.

MySQL - Rows to Columns

I tried to search posts, but I only found solutions for SQL Server/Access. I need a solution in MySQL (5.…

mysql sql pivot-table etl crosstab
PostgreSQL Crosstab Query

Does any one know how to create crosstab queries in PostgreSQL? For example I have the following table: Section Status …

sql postgresql pivot case crosstab
Postgres - Transpose Rows to Columns

I have the following table, which gives multiple email addresses for each user. I need to flatten this out to …

sql database postgresql crosstab transpose
Create a pivot table with PostgreSQL

Suppose I have a table in Postgres called listings that looks like this: id neighborhood bedrooms price 1 downtown 0 256888 2 downtown 1 334000 3 riverview 1 505000 …

sql database postgresql aggregate-functions crosstab
Groupby value counts on the dataframe pandas

I have the following dataframe: df = pd.DataFrame([ (1, 1, 'term1'), (1, 2, 'term2'), (1, 1, 'term1'), (1, 1, 'term2'), (2, 2, 'term3'), (2, 3, 'term1'), (2, 2, …

python pandas dataframe crosstab pandas-groupby
PostgreSQL convert columns to rows? Transpose?

I have a PostgreSQL function (or table) which gives me the following output: Sl.no username Designation salary etc.. 1 A …

sql postgresql pivot-table dynamic-sql crosstab
I need to know how to create a crosstab query

I need help creating the below results. I thought of a sql pivot but I don't know how to use …

sql pivot crosstab
How to make a pandas crosstab with percentages?

Given a dataframe with different categorical variables, how do I return a cross-tabulation with percentages instead of frequencies? df = pd.…

python pandas crosstab
How to create an Access crosstab query with totals for the columns AND the rows?

I want my query result to look like this: Person1 Person2 Person3 Person4 Total Status1 2 4 7 3 16 Status2 0 1 0 3 4 Status3 0 0 0 0 0 Status4 0 1 3 0 4 Total 2 6 10 6 24 I'm …

sql ms-access crosstab
Dynamic alternative to pivot with CASE and GROUP BY

I have a table that looks like this: id feh bar 1 10 A 2 20 A 3 3 B 4 4 B 5 5 C 6 6 D 7 7 D 8 8 D And …

sql postgresql pivot crosstab window-functions