I have this data in postgreSQL
Id type quantity
1 order 10
2 order 12
3 order 11
4 purchase 5
5 purchase 4
6 credit 2
I would like to return the quantity negative when the type = 'order' or 'credit
Id type quantity
1 order -10
2 order -12
3 order -11
4 purchase 5
5 purchase 4
6 credit -2
How do i do this in postgresql?