I have a table to data that I want to export to a CSV. Ideally, I\'d like to switch the rows and columns around, so that the data is grouped a little better.
To expl
Just join the table to itself!
SELECT dt1.data_timestamp, dt1.input_1, dt2.input_2
FROM data_timestamp dt1
JOIN data_timestamp dt2
on dt1.data_timestamp = dt2.data_timestamp
and dt2.input_1 is null
WHERE dt1.input_2 is null;
Note that this query assumes input_2's value are present for every input_1 value. If that's not that case, use LEFT JOIN
or CROSS JOIN
etc