I would appreciate help with a table that is looking like this:
client_id | transaction_date | amount
-------------------------------------
123 | 2017-01-16 | 12
234 | 2017-01-11 | 25
345 | 2017-01-12 | 211
I want to get the average for a period of time that the same client did next transaction - in other words - what was the avg number of days that led to the next transaction for certain user?
I was thinking of some TIMESTAMPDIFF, but no idea how to implement that in this case.