0
我運行以下查詢多次:MySQL的插入多行與一個選擇
insert ignore into temp_table (ID, Price, Stock, Vendor)
select ID, Price_Vendor_A, Stock_Vendor_A, 'Vendor_A' from temp_table2 limit 1;
insert ignore into temp_table (ID, Price, Stock, Vendor)
select ID, Price_Vendor_B, Stock_Vendor_B, 'Vendor_B' from temp_table2 limit 1;
的2個選擇查詢導致在同一行。
有沒有更快的方法來做到這一點?
查詢似乎工作,但這只是創建了兩個排,與股票和供應商A的價格如何使用您的查詢以創建兩行,一行與供應商A和一個與供應商B? – Vidarrus
糟糕,你能告訴我在哪裏使用這個SQL嗎?在代碼或在過程/功能/ SQL編輯器? – meet
我在MySQL中創建一個過程。我的sqleditor被稱爲HeidiSQL。 – Vidarrus