Return last two max values

Last Post 08 Nov 2004 12:16 PM by maggi. 0 Replies.
AddThis - Bookmarking and Sharing Button
Author Messages
New Member
New Member

08 Nov 2004 12:16 PM
I have an empolyee payment table by employee number, payment_date, period_end_date and payment. Some time for some employees by each payment_date, there are two or three or four period_end_date. I need write a query to only return last two (period_end_date)s for each payment_date for all employees, no matter how many period_end_date they have on by each payment_date. Can you provide some samples to write this query?

Platform: SQL2k sp3, win 2k sp

Acceptable Use Policy