I had 2 tables
User and Product
for user
id
for product
id
amount - price of this product
user_id - foreign key
created - date of creating product
i need to get list of Users sorted by sum of amounts of their products that they created by last month
Thus, i shoud to get the number of users sorted by the largest product amount to the smallest amount sum, but only by the number of products created in the last month and newer.
how to do this in sql?