2
"insert into NodeProfileSections (profile_no, tpl_section_no)
select (np.profile_no, tps.tpl_section_no)
from NodeProfile np, TemplateProfileSection tps, TemplateProfile tp
where np.hostname = '%s' AND np.role = '%s' AND tp.tpl_profile_no = tps.tpl_profile_no
AND tp.tpl_name = '%s' AND tp.role = '%s' AND tps.tpl_section_name = '%s';"
%(hostname, role, template_name, role, section_name)
error_message = 'Operand should contain 1 column(s)'
操作数应包含1列(S)约INSERT INTO和选择
如何解决这个问题呢?
真的......非常感谢。但我想知道如何?谢谢 – user1038890 2012-07-08 09:57:36
从内部select中删除'('和')';因为它不是正确的SQL语法。有关更多信息,请参阅[mysql文档](http://dev.mysql.com/doc/refman/5.1/en/insert-select.html)。 – 2012-07-08 12:57:48
感谢大家告诉我答案,我错过了这个关键点。 – user1038890 2012-07-10 01:13:47