خرید بک لینک

Vote count: 0

I have a table with this contents:

Table1: MySQL Table Content ( Table: 'sensors' )

        Date         |    Topic    |  Value
-------------------------------------------
2016/06/15 13:22:11  |  pressure   |  10.52
2016/06/15 13:22:11  | temperature |  55.25
2016/06/15 13:23:42  | temperature |  40.12
2016/06/15 13:25:10  |  pressure   |   8.10
2016/06/15 13:25:13  | temperature |  47.24
2016/06/15 13:27:30  |  pressure   |  11.47
2016/06/15 13:27:30  | temperature |  52.27

And I want to do a select to retrive this view:

Table2: Query result from table 'sensors'

        Date         |  pressure   |  temperature
-------------------------------------------------
2016/06/15 13:22:11  |    10.52    |    55.25
2016/06/15 13:23:42  |             |    40.12
2016/06/15 13:25:10  |     8.10    |
2016/06/15 13:25:13  |             |    47.24
2016/06/15 13:27:30  |    11.57    |    52.27

I want select DISTINCT Date from 'sensors' table and then fill with the value from topic (if not exist at that time the value will be empty)

PS. Table 'sensors' have multiples topics, but I only need the 'pressure' and 'temperature' values to build a chart.

Thanks

asked 39 secs ago

برچسب: نویسنده: استخدام کار تاريخ: جمعه 28 خرداد 1395 ساعت: 5:11

صفحه بندی