Given a table row such as:
id | username | att7 | att28 | atttotal
1 | 12345 | 77 | 88 | 99
Is there a way in SQL (I am using MySQL at the moment, but can be any database really) to convert that so that the output in my VIEW would be something like:
id | username | type | period | value
1 | 12345 | Att | 7 Days | 77
2 | 12345 | Att | 28 Days | 88
3 | 12345 | Att | Total | 99
I am reading about PIVOT tables at the moment, as I feel like that might be what is needed, but so far am not able to work out how I'd actually go about this..
Cheers.