title: MySQL - how to insert values from one table into another with string matching?
body: <p>MySQL noob here; looked around first but couldn't find the answer to this question.</p>
  
  <p>So I have two tables in MySQL, one (Table1) which consists of one column containing unique list of names (Col1) and another containing corresponding binary values (Col2). The second table (Table2) contains a list of recurring names with a empty column waiting to be filled with binary values from the first table. What I want to do is, for each instance of a recurring name in Table2, insert the binary value from Col2 associated with the matching unique name in Table1. </p>
  
  <p>I know how to do this in Excel—you just place the following VLOOKUP statement next to every row containing a recurring name. In the following code snippet A2 is a recurring name, unique names are contained in column B, and the binary values are contained in column C. </p>
  
  <pre><code>=VLOOKUP(A2,$B$2:$C$106095,2,FALSE)
  </code></pre>
  
  <p>But I can't for the life of me figure out how to reproduce this effect in MySQL. I can't use Excel because there's too much data. Anyone have any ideas? Thanks in advance!</p>