i have a table called "sell", contain some field like :
device_id qiantity_sold date
1 2 2017-11-22
2 1 2017-11-22
2 10 2017-11-23
then i want to create SP, for count based date range , and become
date total_id total_quantity_sold percentage
2017-11-22 2 3 0.6
2017-11-23 1 10 0.1
total_id = total device id that have quantity sold at same date
total_quantity_sold = total quantity sold at same date
percentage = 100% * total_id/total_quantity_sold