title: How to debug : Subquery returns more than 1 row
body: <p>I am loading CSV data into mysql and replacing a value from a column with its corresponding value from another existing table.</p>
  
  <p>I am doing this using a sub query which is supposed to always return a single value, but it turns out that this table did not have the referenced column be unique. And having duplicate values on the referenced column makes the sub query return multiple values, which is understandable.</p>
  
  <p>Is there anyway to tell MySql to be more expressive about which line in the loading faze triggered this error ? or any way of debugging this issue ?</p>
  
  <p>I want to find the lines in the current table that reference rows that have duplicate columns, so I would be able to manually check each one of the duplicates to make sure I reference the right data from the first table.</p>
  
  <p>Example SQL</p>
  
  <pre><code>LOAD DATA
  LOCAL INFILE 'file.csv'
  REPLACE INTO
  TABLE `db`.`table`
  CHARACTER SET 'utf8'
  FIELDS TERMINATED BY ','
  OPTIONALLY ENCLOSED BY '"'
  #ESCAPED BY '"'
  LINES TERMINATED BY '\n'
  IGNORE 1 LINES
  (
   @old_value
  )
  SET
  `column` = (
      SELECT new_column from `db`.`other_table`
      where old_column = @old_value
  );
  </code></pre>