更新时间:2023-01-19 20:36:20
Hmmm. . .如果需要进行汇总,则需要在join
:
Hmmm . . . If you need to do aggregation, you need to do it before the join
:
Delete t
from TablenName t join
(select op.product_id, sum(op.quantity) as sumquantity
from oc_order_product op
group by op.product_id
) op
on op.product_id = t.product_id and op.sumquantity < 2;