Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [ {
- "timestamp" : 1507320877294,
- "color" : "red",
- "balloon" : {
- "x" : 42,
- "y" : 312,
- "z" : 287,
- }
- } ]
- [ {
- "timestamp" : 1607320877294,
- "color" : "yellow",
- "balloon" : {
- "x" : 42,
- "y" : 312,
- "z" : 287,
- }
- } ]
- |--------------------------------------------------------------------
- | spotter_sensor_id | hour_collected | red_balloons| yellow_balloons|
- |--------------------------------------------------------------------
- | 992 | 17:00:00 | 5 | 5 |
- ---------------------------------------------------------------------
- INSERT INTO table
- (spotter_sensor_id, hour_collected, red_balloons, yellow_balloons)
- VALUES
- ('992', '$hour_collected', '$red_balloons', '$yellow_balloons')
- ON DUPLICATE KEY UPDATE
- red_balloons = $red_balloons + VALUES(red_balloons),
- yellow_balloons = $yellow_balloons + VALUES(yellow_balloons);
Add Comment
Please, Sign In to add comment