id | year | month | day | hour | value | id_parameter |
| 2016 | 5 | 20 | 4 | 999 | 301 |
| 2016 | 5 | 20 | 4 | 888 | 300 |
| 2016 | 5 | 20 | 4 | 999 | 301 | -- исходная
| 2016 | 5 | 20 | 5 | 999 | 301 |
| 2016 | 5 | 20 | 6 | 999 | 301 |
| 2016 | 5 | 20 | 7 | 999 | 301 |
| 2016 | 5 | 20 | 4 | 888 | 300 | -- исходная
| 2016 | 5 | 20 | 5 | 888 | 300 |
| 2016 | 5 | 20 | 6 | 888 | 300 |
| 2016 | 5 | 20 | 7 | 888 | 300 |
SELECT `year`, `month`, `day`, `hour` + a, `value`, id_parameter
FROM `таблица`,
(select 0 a union select 1 union select 2 union select 3) t order by 5 desc, 4;
SELECT `year`, `month`, `day`, `hour` + t.id -1, `value`, id_parameter
FROM `таблица`,
(select id from `таблица в которой есть id от 1 до 4` where id<5) t order by 5 desc, 4;