如何使用此查询更新table1的列?
update table1
set table1.column5 = (
select count(*)
from table2, table1
where table1.column1 = table2.column4
group by table1.column1)
table1有这些列(column1,column2,column3,column4,column5)
table2有这些列(column1,column2,column3,column4)
和table2.column4是table1.column1的外键
2 回答
用这个
或这个
试试这个查询