I have a table Like This
Id|purchase_date | Purchase_price
1 |02-May-17 |$10.00
2 |02-May-17 |$20.00
3 |02-May-17 |$30.00
I want to write a query where the sum of all purchase_price will calculated on the basis of purchase_date. Can Someone Please suggest the query?
You can try this with groupby clause
select sum(replace(Purchase_price, '$', '')) as total from tbl group by purchase_date

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With