从一个查询可以做吗?
将多个选定行信息从一个表插入到另一个表中,例如:
Customers (register_no,CustomerName, City, Country)
Suppliers(register_no,SupplierName, City, Country)
INSERT INTO Customers (register_no,CustomerName, City, Country) SELECT register_no SupplierName, City, Country FROM Suppliers where register_no=10;
但是一次可以选择register_no=1,register_no=3,register_no=10;在一个查询中
是的,可以通过使用
INSERT INTO Customers (register_no,CustomerName, City, Country)
SELECT register_no SupplierName, City, Country FROM Suppliers where register_no in (1,3,10)
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句