Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pivot not showing results (duckdb) #952

Open
edublancas opened this issue Nov 29, 2023 · 1 comment
Open

pivot not showing results (duckdb) #952

edublancas opened this issue Nov 29, 2023 · 1 comment

Comments

@edublancas
Copy link

from slack

image

@dmcmurchy
Copy link

Data is from here

%%sql
CREATE TABLE Cities (Country VARCHAR, Name VARCHAR, Year INT, Population INT);
INSERT INTO Cities VALUES ('NL', 'Amsterdam', 2000, 1005);
INSERT INTO Cities VALUES ('NL', 'Amsterdam', 2010, 1065);
INSERT INTO Cities VALUES ('NL', 'Amsterdam', 2020, 1158);
INSERT INTO Cities VALUES ('US', 'Seattle', 2000, 564);
INSERT INTO Cities VALUES ('US', 'Seattle', 2010, 608);
INSERT INTO Cities VALUES ('US', 'Seattle', 2020, 738);
INSERT INTO Cities VALUES ('US', 'New York City', 2000, 8015);
INSERT INTO Cities VALUES ('US', 'New York City', 2010, 8175);
INSERT INTO Cities VALUES ('US', 'New York City', 2020, 8772);
%%sql
PIVOT Cities 
ON Year 
USING SUM(Population);

Should produce:

Country Name 2000 2010 2020
US Seattle 564 608 738
NL Amsterdam 1005 1065 1158
US New York City 8015 8175 8772

but only displays the column headings.

Tested again today using jupysql 0.10.16 and duckdb 1.1.3. Not sure if it ever worked with jupysql.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants