title: MYSQL move tables to second database and filter
body: <p>I am trying to move tables from one database to another.  I am filtering the data during the process.  For instance:</p>
  
  <pre><code>DROP TABLE IF EXISTS target_db.products;
  CREATE TABLE target_db.products LIKE original_db.products;
  INSERT INTO target_db.products 
      SELECT * FROM original_db.products 
      WHERE products_status = 1 
          AND products_date_added &gt; (SELECT DATE_SUB(now(), INTERVAL 18 MONTH));
  </code></pre>
  
  <p>This works fine and I get the records I expect.  But when the WHERE phrase includes another table it fails (because the column list does not match.) For example:</p>
  
  <pre><code># export products
  DROP TABLE IF EXISTS target_db.products_description;
  CREATE TABLE target_db.products_description LIKE original_db.products_description;
  INSERT INTO target_db.products_description 
      SELECT * FROM original_db.products_description pd,  original_db.products p  
      WHERE p.products_status = 1 
          AND p.products_date_added &gt; (SELECT DATE_SUB(now(), INTERVAL 18 MONTH)) 
          AND pd.products_id = p.products_id;
  </code></pre>
  
  <p>Is there a way around this other than overly specifying the columns?</p>