This question shows research effort; it is useful and clear
-1
This question does not show any research effort; it is unclear or not useful
Bookmark this question.
Show activity on this post.
我想在每次添加或删除新行时运行此查询
UPDATE brandnames updated
JOIN (select bname, count(*) as cnt
from brandnames
group by bname) aggregate
ON updated.bname= aggregate.bname
set `count`= aggregate.cnt