I have table with this records
product_id quantity color
1 10 red
1 20 black
1 30 green
1 40 red
1 50 black
2 60 black
2 70 green
2 80 black
I want with query to got this result
product_id red black green
1 50 70 30
2 0 140 70
There are only 3 colors (red, black, green)