我有三个表,如table1,table2,table3 ..
我需要一个mysql解决方案 .
从 table1,table2 中选择 table1.val1,table2.val1 并更新返回的值,如..
更新 table3 设置 value=table1.val1 其中 value=table2.val1
我的查询不起作用..
update db1.proprietor_profile_tbl as c3 set c3.PPROFILE_profileid=(select c2.COM_id from db2.company_profile_tbl as c1,db1.company_profile_tbl as c2 where c1.COM_name=c2.COM_name and COM_profiletype!=4) where c3.PPROFILE_profileid=c1.COM_id
Unknown column 'c1.COM_id' in 'where clause'
1 回答