I am trying to create a new table using values from another table. The query I have so far is getting values from an existing table and inserting them into the new table, but I am trying to find the syntax for inserting a value into a unique column in new table as well as using values from another table. Can anybody help me?
MySqlConnection conn = new MySqlConnection(connectionSQL);
conn.Open();
MySqlCommand cmd = new MySqlCommand("INSERT INTO TransactionsTemp(barcode, name, price) SELECT barcode, name, price FROM Product WHERE barcode='" + textBox1.Text + "'", conn);
cmd.ExecuteNonQuery();
conn.Close();