Welcome Guest, Not a member yet? Register   Sign In
Insert if not exists possible with CI?
#4

[eluser]danmontgomery[/eluser]
[quote author="Michael Wales" date="1265403654"]If you have these two columns indexed as unique you can just perform the insert. MySQL will see they already exist and continue on with its day.

Doesn't require the additional select query noctrum suggested and uses less resources than INSERT ... ON DUPLICATE KEY UPDATE.[/quote]

True, but only viable if a_id and b_id have a 1:1 relationship, and there is only one entry for each


Messages In This Thread
Insert if not exists possible with CI? - by El Forum - 02-05-2010, 08:43 AM
Insert if not exists possible with CI? - by El Forum - 02-05-2010, 08:52 AM
Insert if not exists possible with CI? - by El Forum - 02-05-2010, 09:00 AM
Insert if not exists possible with CI? - by El Forum - 02-05-2010, 09:12 AM
Insert if not exists possible with CI? - by El Forum - 02-05-2010, 09:30 AM
Insert if not exists possible with CI? - by El Forum - 02-05-2010, 10:03 AM
Insert if not exists possible with CI? - by El Forum - 02-05-2010, 03:43 PM
Insert if not exists possible with CI? - by El Forum - 02-05-2010, 04:53 PM
Insert if not exists possible with CI? - by El Forum - 02-06-2010, 12:18 AM
Insert if not exists possible with CI? - by El Forum - 02-06-2010, 04:29 PM
Insert if not exists possible with CI? - by El Forum - 02-06-2010, 06:32 PM



Theme © iAndrew 2016 - Forum software by © MyBB