Get Max() record from table by group

Posted by Garcia Julien on Stack Overflow See other posts from Stack Overflow or by Garcia Julien
Published on 2010-04-04T09:35:05Z Indexed on 2010/04/04 9:43 UTC
Read the original article Hit count: 303

Filed under:
|
|
|

Hi, i've got a table like that :

Article Number  Last Voucher Number Last Voucher Date
0557934         519048                  04/02/2005
0557934         519067                  04/02/2005
0557934         528630                  09/29/2005
0557934         528631                  09/29/2005
0557934         529374                  10/13/2005
0557934         529375                  10/13/2005
0557934         529471                  10/16/2005
0557934         529472                  10/16/2005
0557934         535306                  01/08/2006
0557934         535307                  01/08/2006
0557934         1106009                 08/10/2006
0557934         1106010                 08/10/2006
0022738         22554                   02/20/1995
0022738         22595                   03/12/1995
0022738         22597                   03/15/1995
0022738         22605                   03/19/1995
0022738         22616                   03/25/1995
0022738         22621                   03/28/1995
0022738         22630                   04/05/1995

I would like to have only the record with the last date :

Article Number  Last Voucher Number Last Voucher Date
0557934         1106010                 08/10/2006
0022738         22630                   04/05/1995

I can do directly on SQL or on Linq.

Any idea?

Ju

© Stack Overflow or respective owner

Related posts about sql

Related posts about LINQ