CodePudding user response:
It's the wrong writingCodePudding user response:
- 1. The subquery according to customer's id, statistics about the quantity of each customer, (o. chua ust_id=Arthur c. ust_id)
-- the equivalent of each record statistics a alone, so don't grouping,
The select Arthur c. ust_name
The from customer_tbl c
Where 10 & lt; (
Select sum (o.q ty)
The from orders_tbl o
Where o. chua ust_id=Arthur c. ust_id
)