I have a table named sales_table like below
Date | type | amount |
---|---|---|
2021-12-01 | Cash | 100 |
2021-12-01 | Google Pay | 200 |
2021-12-01 | Google Pay | 300 |
2021-12-02 | Cash | 100 |
2021-12-02 | Google Pay | 200 |
2021-12-02 | Google Pay | 200 |
I want need some query in SQL so that I can get data in below format.
Date | Cash | Google Pay |
---|---|---|
2021-12-01 | 100 | 500 |
2021-12-02 | 100 | 400 |
Can anyone please help with this?