I'm trying to split results into different column, I've been searching for that for few days but couldn't find the correct term of what I'd like to do. I'm probably using wrong key words.
I have a table like this:
Timestamp System Value
1 1 13
1 2 12
1 3 5
2 1 37
2 2 12
2 3 55
3 1 12
3 2 45
3 3 45
And I would like to get a result like that:
Timestamp, System1val, System2val, System3val
1 13 12 5
2 37 12 55
3 12 45 45
I'm pretty sure it's possible to do it. I've been close by using:
SELECT
FROM_UNIXTIME(timestamp) as time,
CASE System
WHEN '1' THEN System
END AS System1val,
CASE System
WHEN '2' THEN pyr.measure_conv
END AS System2val,
CASE System
WHEN '3' THEN pyr.measure_conv
END AS System3val
FROM
This actually return different fields and fill in with NULL value. The final goal would be to group by timestamp and have all three values
pivot.