title: how do I UPDATE specific columns in a table from CSV without replacing the entire row?
body: <p>I have a set of csv files I'm importing into mysql and I made a few mistakes in sorting the data. I need to do a mass update of specific rows in a table without updating the entire table (there have been a few changes to the table and importing everything over again will revert the changes).</p>
  
  <p>this is the command I've been using to import the csv files:</p>
  
  <pre><code>LOAD DATA LOW_PRIORITY LOCAL INFILE 'C:\\location\\of\\CSVs\\import.csv' 
  REPLACE INTO TABLE `database`.`contacts` CHARACTER SET utf8 
  FIELDS TERMINATED BY ',' 
  OPTIONALLY ENCLOSED BY '"' 
  LINES TERMINATED BY '\r\n' 
  IGNORE 2 LINES 
  (`id`, `deleted`, `salutation_name`, `first_name`, `last_name`, `account_id`, 
  `description`, `created_at`, `modified_at`, `created_by_id`, 
  `modified_by_id`, `assigned_user_id`);
  </code></pre>
  
  <p>I tried to use INSERT in place of REPLACE:</p>
  
  <pre><code>LOAD DATA LOW_PRIORITY LOCAL INFILE 'C:\\location\\of\\CSVs\\import.csv' 
  INSERT INTO TABLE `database`.`contacts` 
  CHARACTER SET utf8 
  FIELDS TERMINATED BY ',' 
  OPTIONALLY ENCLOSED BY '"' 
  LINES TERMINATED BY '\r\n' 
  IGNORE 2 LINES 
  (`id`, `created_by_id`, `assigned_user_id`);
  </code></pre>
  
  <p>But it threw errors (expectedly) and didn't update a dang thing!</p>
  
  <p>Basically I want to import only two of the columns, <code>created_by_id</code> and <code>assigned_user_id</code>, from the csv based on the first column, <code>id</code> but I'm not entirely sure how to do that without replacing everything in the table.</p>
  
  <p>I'm pretty sure I need  <code>WHERE</code> statement in there somewhere to tell mysql what to base it's changes on, but I'm not entirely sure what/where to put in.</p>
  
  <p>To be clear, I am a bit of a mysql script kiddie (this is my first database and first foray into mysql), but I was smart enough to create a db backup and copied the table to a temp table before tinkering with things.</p>