# #1587 Bank Account Summary II

#### [https://leetcode.com/problems/bank-account-summary-ii/](https://leetcode.com/problems/bank-account-summary-ii/)

{% tabs %}
{% tab title="MS SQL Server" %}
```sql
SELECT u.name, SUM(t.amount) AS balance
FROM Users u JOIN Transactions t
ON u.account = t.account
GROUP BY u.name
HAVING SUM(t.amount) > 10000
```
{% endtab %}
{% endtabs %}
