Last updated April 13, 2010. Created by grub3 on April 13, 2010.
Log in to edit this page.
MySQL has a nice SQL feature to update records when a duplicate key exist.
Example:
INSERT INTO single_login_history
SET uid = 'titi',
session_id = 'sdklfsldkjflksdjfkls',
date = 37487,
ip = '192.243.0.1',
browser = 'Geko', type = 'cookie'
ON DUPLICATE KEY
UPDATE date = 45034";This feature is not part of SQL99. It will fail on any database.