i have a table `user(id,name)` and a table `payments(date,amount,user_id)`

I need a query to display for each user the total sum of payments and the payments in last month.

```
User - totalpayments - monthlypayments

```

something like this

1. `SELECT id, name from user;`
2. `SELECT COUNT(amount) FROM payments WHERE user_id=user.id;`
3. `SELECT COUNT(amount) FROM payments WHERE user_id=user.id AND (data<=$timestamptoday AND data>=$timestamp1stday)`

is it possible to do that without doing many queries?