SQL Query find out the bottom two date against each a_id [message #434238] |
Tue, 08 December 2009 01:37  |
kr_arvind
Messages: 85 Registered: April 2006 Location: Delhi
|
Member |
|
|
Hi,
Please help against the below input and output, I need to sum of amount against the each a_id for the bottom two dates.
A_ID d_DATE AMT
1 10/07/08 352
1 11/07/08 2794
2 12/07/08 1951
2 01/07/09 1326
3 02/07/09 889
3 03/07/09 1684
3 04/07/09 2099
3 05/07/09 1684
OUTPUT (Sum of the amount for the Bottom 2 date against the each a_id)
1 3146
2 3276
3 2572
Regards,
Arvind Kumar
|
|
|
|
|
|