Given a table with the fields id, product name, user_id and the amount of a single purchase. It is necessary to choose the user_id total amount of purchases, which are more than 1000, I have already broken my head,
SELECT user_id FROM table1 WHERE SUM(sum)>=1000; - does not work. Thanks in advance