我有两个名为newlab
和deadstock
的表都在同一个数据库中我想复制newlab的一些字段到deadstock,为此我使用以下代码
INSERT INTO deadstock
(MAC,Lab_Code,PC_Name,Purchase_Order_No,
Brand,Model,Price,Processor,Ram,HDD,HDD_Type)
SELECT (MAC,Lab_Code,PC_Name,Purchase_Order_No,
Brand,Model_Name,Price,Processor,Ram,HDD,HDD_Type)
FROM newlab WHERE PC_Name='".$PC_Name."';
但是它给出的操作数应该包含一列错误
试试这个代码
INSERT INTO deadstock
(MAC,Lab_Code,PC_Name,Purchase_Order_No,
Brand,Model,Price,Processor,Ram,HDD,HDD_Type)
SELECT MAC,Lab_Code,PC_Name,Purchase_Order_No,
Brand,Model_Name,Price,Processor,Ram,HDD,HDD_Type
FROM newlab WHERE PC_Name='".$PC_Name."';