So say i want to query some data form a postgresql table.
The table contains timeseries data and has the columns curve_id, datetime, value, edit_datetime.
Now when querying from excel I just write the simple:
SELECT *
FROM Table
WHERE curve_id IN ('Var1', 'Var2' ...)
That returns one long list.
curve_id, datetime, value, edit_datetime
(VAR1, 2021-10-07 00:00:00, 17,2021-10-07 01:51:05 ),
(VAR2, 2021-10-07 00:01:00, 19,2021-10-07 02:43:05 ),
(VAR1, 2021-10-07 00:01:00, 18,2021-10-07 01:51:05 ),
(VAR2, 2021-10-07 00:01:30, 20,2021-10-07 02:55:05 )
But say I want the output table in a format where each variable gets its own column. How do I proceed to do that in the SQL code and not just do a fix in Excel?
Something like
Datetime, VAR2_value, VAR2_value
(2021-10-07 00:00:00, 17, *),
(2021-10-07 00:01:00, 18, 19),
(2021-10-07 00:01:30, *, 20)