我正在尝试执行以下操作:
INSERT INTO job_additions (sor_no, sor_desc, invoice_no, qty, debit_credit)
VALUES
('CAR102008',(select sor_desc from sor_data where sor_no= CAR102008),'INV001002','2','d')
但我在“字段列表”中遇到未知列“sor_desc”的错误
是否可以插入从其他表中选择的数据?
非常感谢,
约翰
最佳答案
试试这个:
insert into job_additions (sor_no, sor_desc, invoice_no, qty, debit_credit)
select 'CAR102008', sor_desc, 'INV001002','2','d'
from sor_data
where sor_no= 'CAR102008'