title: MySQL subquery error on the comparison variable in the subquery
body: <p>I've tried several ways to implement a subquery in the select clause. Basically I just want to lookup a date in one table and store it in another table.  In this example I get an error "Unknown column 'areckey' in where clause"</p>
  
  <pre><code>insert into cmeFillCompaction  set
    reckey=2421,
    areckey=3170,
    WEBDATE=(select pickupdate from cmeSchedule s where s.reckey=areckey)
  on duplicate key update
    reckey=2421,
    areckey=3170,
    WEBDATE=(select pickupdate from cmeSchedule s where s.reckey=areckey)
  </code></pre>
  
  <p>what would the proper syntax be?</p>