Let's say I have a table with the following dates:
2017-09-07
2017-09-07
2017-09-07
2017-09-07
2017-09-07
2017-09-07
2015-09-09
2014-09-13
2014-09-13
2014-09-13
2014-09-13
2012-09-11
2012-09-11
2012-09-07
2012-09-07
How can I get the days difference between date changes (how many days passed from a date change)
I should get this:
DATE DAYSPASSED
----------------------
2017-09-07 729
2017-09-07 729
2017-09-07 729
2017-09-07 729
2017-09-07 729
2017-09-07 729
2015-09-09 361
2014-09-13 732
2014-09-13 732
2014-09-13 732
2014-09-13 732
2012-09-11 4
2012-09-11 4
2012-09-07 0
2012-09-07 0
