I have a table that has wholesale data and retail data. the data is structured as
| Channel | Serial# | Date |
|---|---|---|
| WS-Build | 12345 | 1/1/2019 |
| WS-Dealer | 34567 | 1/5/2021 |
| Retail | 12345 | 1/1/2020 |
| Retail | 34567 | 3/5/2021 |
I would like the output to match on serial#
Each serial # will appear twice in the table. I am trying to get a count of # of units sold via builder or dealer.
| Serial# | Channel | WholesaleDate | Retail Date |
|---|---|---|---|
| 12345 | WS-Build | 1/1/2019 | 1/1/2020 |
| 34567 | WS-Dealer | 1/5/2021 | 3/5/2021 |
How can i achieve that by joining on the same table?
Try join by serial and channel