I have a table as follow :

```
id      int(20)
ip      varchar(25)
temp    float
batt    int(4)
date    datetime

```

This table is fed from sensors gathering data and filling the table every 15 seconds.

```
1   fe80::212:4b00:60d:b27f 17.62   3256    2017-03-20 01:58:31
2   fe80::212:4b00:60d:6215 19.524  3264    2017-03-20 01:58:43
3   fe80::212:4b00:60d:b27f 17.62   3256    2017-03-20 01:58:46
4   fe80::212:4b00:60d:6215 19.524  3263    2017-03-20 01:58:58
5   fe80::212:4b00:60d:b27f 17.62   3256    2017-03-20 01:59:01

```

I wish to get the average temperature (`temp`) by sensor (`ip`) and by hour (`date`)

Something like the following output :

```
           IP              00:00   01:00   02:00   ... 
fe80::212:4b00:60d:b27f    18.16   18.20   18.23   ...
fe80::212:4b00:60d:6215    19.54   20.12   20.30   ...

```

Any idea about how to get crossed-data output in mysql ?