'(PostgreSQL) Table A tied to multiple entries in Table B, Need to Sum the number in a column of each Table B entry
I'm working on a SQL project and I'm a bit stuck trying to pull a specific piece of data.
Table A contains a_id (primary ID), and a_name, while table B contains b_id (primary ID), b_name, and b_sales. A third table contains a_id, and b_id.
In this example, there are multiple entries in table B for each entry in Table A, I want to sum b_sales for each entry in Table A.
So if a Table A entry is tied to 2 entries in Table B, each with b_sales of 5 for example, I want to show that A Entry has having 10 total b_sales.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
