Dear all, I've a table like below. Could anyone tell me what will be the query to get the date difference of last two payment dates of distinct user ID.
user_id amount_paid payment_date
X 102 11/2/13
A 89 18/2/13
X 93 15/2/13
X 85 17/1/12
Z 87 19/2/13
A 86 3/1/13
A 78 13/1/13
user_id amount_paid payment_date
X 102 11/2/13
A 89 18/2/13
X 93 15/2/13
X 85 17/1/12
Z 87 19/2/13
A 86 3/1/13
A 78 13/1/13