title: Insert distinct values from one table into another table
body: <p>So for each distinct value in a column of one table I want to insert that unique value into a row of another table.</p>
  
  <pre><code>list = select distinct(id) from table0
  
  for distinct_id in list
   insert into table1 (id) values (distinct_id)
  end
  </code></pre>
  
  <p>Any ideas as to how to go about this?</p>