123456789 |
- SELECT DISTINCT
- g.account_description,
- COUNT(line_item_amount) AS line_item_amount_count,
- SUM(i.line_item_amount) AS line_item_amount_sum
- FROM general_ledger_accounts g JOIN invoice_line_items i
- ON g.account_number = i.account_number
- GROUP BY g.account_description
- HAVING line_item_amount_count > 1
- ORDER BY line_item_amount_sum DESC;
|