LMSouq
general-dev Open

"INSERT IGNORE" vs "INSERT ... ON DUPLICATE KEY UPDATE"

TH
Thomas G Henry LLC
1 month ago
3 views
Problem Description
While executing an `INSERT` statement with many rows, I want to skip duplicate entries that would otherwise cause failure. After some research, my options appear to be the use of either: - `ON DUPLICATE KEY UPDATE` which implies an unnecessary update at some cost, or - `INSERT IGNORE` implies an invitation for other kinds of failure to slip in unannounced. Am I right in these assumptions? What's the best way to simply skip the rows that might cause duplicates and just continue on to the other rows?

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base