-
Notifications
You must be signed in to change notification settings - Fork 843
Closed
Labels
C-featureCategory: featureCategory: feature
Description
Summary
Description for this feature.
this should work
select $1, $2 from (select 1,2,3);
CREATE OR REPLACE TABLE monthly_sales(empid INT, amount INT, month TEXT);
INSERT INTO monthly_sales VALUES
(1, 10000, 'JAN'),
(1, 400, 'JAN'),
(2, 4500, 'JAN'),
(2, 35000, 'JAN'),
(1, 5000, 'FEB'),
(1, 3000, 'FEB'),
(2, 200, 'FEB'),
(2, 90500, 'FEB'),
(1, 6000, 'MAR'),
(1, 5000, 'MAR'),
(2, 2500, 'MAR'),
(2, 9500, 'MAR'),
(1, 8000, 'APR'),
(1, 10000, 'APR'),
(2, 800, 'APR'),
(2, 4500, 'APR');
SELECT $1, $2, $3
FROM monthly_sales
PIVOT(SUM(amount) FOR MONTH IN (SELECT DISTINCT month FROM monthly_sales))
ORDER BY EMPID
Metadata
Metadata
Assignees
Labels
C-featureCategory: featureCategory: feature