Advertisement
Guest User

Untitled

a guest
Mar 28th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. timestamp | machine_status | product_code
  2. ----------------------|----------------|---------------
  3. '2017-03-01 00:49:02' | NULL | 1
  4. '2017-03-01 00:49:06' | NULL | NULL
  5. '2017-03-01 00:49:10' | 2 | 3
  6. '2017-03-01 00:49:14' | NULL | NULL
  7. '2017-03-01 00:49:18' | 5 | NULL
  8. '2017-03-01 00:49:22' | NULL | NULL
  9. '2017-03-01 00:49:26' | 3 | 0
  10. '2017-03-01 00:49:30' | NULL | NULL
  11. '2017-03-01 00:49:34' | NULL | 6
  12.  
  13. timestamp | machine_status | product_code
  14. ----------------------|----------------|---------------
  15. '2017-03-01 00:49:02' | NULL | 1
  16. '2017-03-01 00:49:06' | NULL | 1
  17. '2017-03-01 00:49:10' | 2 | 3
  18. '2017-03-01 00:49:14' | 2 | 3
  19. '2017-03-01 00:49:18' | 5 | 3
  20. '2017-03-01 00:49:22' | 5 | 3
  21. '2017-03-01 00:49:26' | 3 | 0
  22. '2017-03-01 00:49:30' | 3 | 0
  23. '2017-03-01 00:49:34' | 3 | 6
  24.  
  25. update `recent_grouped`
  26. set `machine_status` = (@n := COALESCE(`machine_status`, @n))
  27. order by `timestamp`;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement