So I have this table:
bid_date bid_count cum_quote_count unique_cust cum_unique_cust
-------- --------- --------------- ----------- ---------------
3/31/2015 25 25 5 5
4/01/2015 50 75 12 10
4/02/2015 5 80 5 13
4/03/2015 48 128 25 20
4/04/2015 61 189 9 32
What I'm tracking here is the cum_unique_cust column. This counts the cumulative unique customers for that day and the days before, however, I do it manually. For example, if I wanted to get the cumulative unique customers for 4/01/2015, I would write DATE(created_at) BETWEEN '2015-03-31' AND '2015-04-01'
, and then do it again for the next dates, copying the results on to Excel.
Is there any way this could be done in MySQL automatically, without me copying and pasting them in Excel?