I have an SQL table like the following:
---------------------------
| Timestamp | Value | Name|
---------------------------
| 12345678 | 2 | abc |
---------------------------
| 12345678 | 3 | abc |
---------------------------
| 78910111 | 4 | cde |
--------------------------
| 56789101 | 1 | abc |
---------------------------
| 56789101 | 2 | cde |
---------------------------
I need to transform it into something like this:
-------------------------
| Timestamp | abc | cde |
-------------------------
| 12345678 | 5 | 0 |
-------------------------
| 56789101 | 1 | 2 |
-------------------------
| 78910111 | 0 | 4 |
-------------------------
Where values in the above table are sums for a particular Name at a particular timestamp the names in the lower table are not known and can be dynamic. I need a SQL query to do this.