Monday, 17th Jun

aba6a3N85SVLJ35347
a455cdN379FXE55P50500524
4ca733EI-ECYA319
4241e2VP-CYWA3194228
4241e2VP-CYWA3194228
aa79f6N774XFA3192019
503d35LY-KITA3194663
503d35LY-KITA3194663
4ca978EI-GKMA320
86d607JA824PA3208835
710432HZ-FAKA3208673
e08594LV-HVTA3208574
7c0d46VH-CWOBE20BL-72
86d629JA825PA3208847
7585b3RP-C8948A3205547
7cf9f4A54-029PC21
a9c2adN728QLC750750-0295
02a1b4TS-INUA3203827
adf61aN999WVC208208B2082

Sunday, 16th Jun

0101deSU-GEUB78938802
76bd4a9V-OJJB78937131
a4bb8aN404ANA21N8758
4d21ea9H-QABB73844792
8a07a5PK-SNMC208
a62e0dN498CLC208208B1299

Saturday, 15th Jun

ace60cN930DZB73963539
a420afN365UPB76365788
4d012dLX-KCLB74435236
78175aB-606RGLF5
a2cf34N280NNE75L17000800
a7dbaaN605UXE75L17000802
49d3acOK-ASTC56X560-5068
a46e40N385DZA3218975
3d5005D-FCOBP46T
ab73f5N837SKCRJ915466

MySQL conditional updates

INSERT INTO daily_events
  (created_on, last_event_id, last_event_created_at)
VALUES
  ('2010-01-19', 23, '2010-01-19 10:23:11')
ON DUPLICATE KEY UPDATE
  last_event_id = IF(last_event_created_at < VALUES(last_event_created_at), VALUES(last_event_id), last_event_id),
  last_event_created_at = IF(last_event_created_at < VALUES(last_event_created_at), VALUES(last_event_created_at), last_event_created_at);

Source: https://thewebfellas.com/blog/conditional-duplicate-key-updates-with-mysql/

Back to Top