I extracted from database a result set like this:
date | bussines attribute
===========|======================
2017-07-20 | A
2017-07-16 | A
2017-07-12 | A
2017-07-01 | B
2017-06-01 | B
2017-05-22 | A
2017-04-11 | C
2017-03-23 | C
What i want to achieve, is to get the last record before every change of the business attribute I mentioned:
2017-07-20 | A
2017-07-01 | B
2017-05-22 | A
2017-04-11 | C
Group by would work here for me, if not the case when the user can switch back to one of the previous values. Any ideas how to workaround it in MySQL?