Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- timestamp | machine_status | product_code
- ----------------------|----------------|---------------
- '2017-03-01 00:49:02' | NULL | 1
- '2017-03-01 00:49:06' | NULL | NULL
- '2017-03-01 00:49:10' | 2 | 3
- '2017-03-01 00:49:14' | NULL | NULL
- '2017-03-01 00:49:18' | 5 | NULL
- '2017-03-01 00:49:22' | NULL | NULL
- '2017-03-01 00:49:26' | 3 | 0
- '2017-03-01 00:49:30' | NULL | NULL
- '2017-03-01 00:49:34' | NULL | 6
- timestamp | machine_status | product_code
- ----------------------|----------------|---------------
- '2017-03-01 00:49:02' | NULL | 1
- '2017-03-01 00:49:06' | NULL | 1
- '2017-03-01 00:49:10' | 2 | 3
- '2017-03-01 00:49:14' | 2 | 3
- '2017-03-01 00:49:18' | 5 | 3
- '2017-03-01 00:49:22' | 5 | 3
- '2017-03-01 00:49:26' | 3 | 0
- '2017-03-01 00:49:30' | 3 | 0
- '2017-03-01 00:49:34' | 3 | 6
- update `recent_grouped`
- set `machine_status` = (@n := COALESCE(`machine_status`, @n))
- order by `timestamp`;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement