简体   繁体   中英

How to insert multiple rows in mysql?

I am trying to insert multiple rows in mysql, i have data which is going to get inserted ( id_order - 5561,5560 & id_employee = 1 current_state = "1" ). So there are two order ids so two different rows should added ideally one with "5561" another with "5560"

INSERT INTO order_history SELECT NULL AS id_order_history,? AS id_employee, id_order, current_state AS id_order_state, CURRENT_TIMESTAMP() AS date_add FROM orders WHERE id_order IN (?);

I am not sure how do i frame the values into the above query any thoughts?

from second table you should select with column names as it is in first table and exact in the same count

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM