By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
| version |
|---|
| PostgreSQL 9.6.19 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.3.1 20191121 (Red Hat 8.3.1-5), 64-bit |
5 rows affected
| salesyear | salesmonth | repeat_cust | new_cust | totalcust | repeat_sales | new_sales | totalsales |
|---|---|---|---|---|---|---|---|
| 2020 | 2 | 1 | 1 | 2 | 74.26 | 126.62 | 200.88 |
| 2020 | 6 | 1 | 1 | 2 | 93.53 | 69.08 | 162.61 |
| 2020 | 7 | 1 | 0 | 1 | 114.53 | null | 114.53 |
| SalesYear | SalesMonth | Repeat_cust (count) | Repeat_cust ($) | New_cust (count) | New_cust ($) | TotalCust | TotalSales |
|---|---|---|---|---|---|---|---|
| 2020 | 2 | 1 | 74.26 | 1 | 126.62 | 2 | 200.88 |
| 2020 | 6 | 1 | 93.53 | 1 | 69.08 | 2 | 162.61 |
| 2020 | 7 | 1 | 114.53 | 0 | null | 1 | 114.53 |