SQLクエリを介して複数の行を挿入しようとしていますシナリオは次のとおりです。1に対して複数の属性がありtestID
、あるテストの属性を別のテストにコピーしたいですTestID
。
INSERT INTO dc_tp_attributes
(Attribute_name,acronym,active,description,testId,
subdepartmentid,
DOrder,Attribute_type,D_A_formula,D_A_formula_desc,
Linesno,DefaultValue,interfaced,ClientID,Enteredby,
Enteredon,drived,parentid,heading,print,interfaceid)
select Attribute_name,acronym,active,description,
635,subdepartmentid,DOrder,Attribute_type,D_A_formula,
D_A_formula_desc,Linesno,DefaultValue,interfaced,
ClientID,Enteredby,Enteredon,drived,parentid,
heading,print,interfaceid
FROM dc_tp_attributes
Where testid=877
testID=877
ここで の属性をにコピーしtestID=635
ています。ID 877 のテストには 10 個の属性があり、testID 635 のテストには 1 個しかありません。AttributeID という名前の Autoincrement Primery Key があり、エラーは次のとおりです。
"Field 'AttributeID' doesn't have a default value"