title: Selecting certain columns from table A and insert to table B
body: <p>Trying to select certain data columns from CART table and add it to ORDER table. I created an insert order method which will copy some columns from CART and add to ORDER table. But an error was thrown because I have a column in ORDER which is "product_stats". Instead of adding "product_stats" to CART, how to query in such a way that product_stats in ORDER will be neglected when copying certain columns from CART?
  Any help would be appreciated! </p>
  
  <p>PS: I am not very familiar with SQL queries. </p>
  
  <p><strong>ORDER and CART table:</strong> </p>
  
  <pre><code> sqLiteHelper.queryData("CREATE TABLE IF NOT EXISTS cart (cart_id INTEGER PRIMARY KEY AUTOINCREMENT, product_image BLOG, product_name TEXT, product_stall TEXT, product_price TEXT)");
  
   sqLiteHelper.queryData("CREATE TABLE IF NOT EXISTS orderT (order_id INTEGER PRIMARY KEY AUTOINCREMENT, product_name TEXT, product_stall TEXT, product_price TEXT, product_stats TEXT)");
  </code></pre>
  
  <p><strong>insert ORDER method:</strong></p>
  
  <pre><code> public void insertOrder(){
      SQLiteDatabase database = this.getWritableDatabase();
      database.execSQL("insert into orderT select cart_id, product_name, product_stall, product_price from cart");
      database.close();
  }
  </code></pre>
  
  <p><strong>Error thrown:</strong> </p>
  
  <pre><code>Caused by: android.database.sqlite.SQLiteException: 4 values for 5 columns (code 1): , while compiling: insert into orderT (order_id, product_name, product_stall, product_price, product_stats) select cart_id, product_name, product_stall, product_price from cart
  </code></pre>