我有两个名为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."';
但它给操作数应该包含一个列错误
答案 0 :(得分:0)
试用此代码
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."';