Closed
Description
What happens?
I try to execute PIVOT query, mention in the Duckdb's documentation, and it throw Invalid input error
Query
PIVOT cities
ON year
USING sum(population);
In terminal, PIVOT query working fine.
To Reproduce
Terminal command:
ducked -ui
CREATE TABLE cities (
country VARCHAR, name VARCHAR, year INTEGER, population INTEGER
);
INSERT INTO cities VALUES
('NL', 'Amsterdam', 2000, 1005),
('NL', 'Amsterdam', 2010, 1065),
('NL', 'Amsterdam', 2020, 1158),
('US', 'Seattle', 2000, 564),
('US', 'Seattle', 2010, 608),
('US', 'Seattle', 2020, 738),
('US', 'New York City', 2000, 8015),
('US', 'New York City', 2010, 8175),
('US', 'New York City', 2020, 8772);
SELECT *
FROM cities;
PIVOT cities
ON year
USING sum(population);
OS:
Mac
DuckDB Version:
v1.2.1 8e52ec4
DuckDB Client:
UI
Hardware:
No response
Full Name:
Jitendra Mishra
Affiliation:
Lumenore
What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.
I have not tested with any build
Did you include all relevant data sets for reproducing the issue?
Yes
Did you include all code required to reproduce the issue?
- Yes, I have
Did you include all relevant configuration (e.g., CPU architecture, Python version, Linux distribution) to reproduce the issue?
- Yes, I have