I have bids table with two bids price columns bidsprice1 and bidsprice2. and all users have bidsprice1 amount, and some users also have bidsprice2 amount.
I want to calculate sum(bidsprice2) based on bidsprice2, if some users have null bidsprice2, then based on its bidsprice1.
How to write this sum query?