Here is a sample of my DATA:
CLIENT_ATTRIBUT :
ID_CLIENT | DATE_CLIENT | ATTRIBUT
----------+-------------+---------
000000001 | 2010:03:01 | 0000010
----------+-------------+---------
000000001 | 2010:02:16 | 0000010
----------+-------------+---------
000000001 | 2010:03:04 | 0000011
----------+-------------+---------
000000002 | 2010:03:01 | 0001000
----------+-------------+---------
CLIENT :
ID_CLIENT | NOM_MARITAL |
----------+-------------+
000000001 | PANTROMANI |
----------+-------------+
000000002 | ELLOUQUIER |
----------+-------------+
I'd like to get, for each ID_CLIENT in the table "CLIENT_ATTRIBUT" :
ID_CLIENT, max(DATE_CLIENT) with its corresponding "ATTRIBUT", and "NOM_MARITAL"
So in the example above :
ID_CLIENT | DATE_CLIENT | ATTRIBUT | NOM_MARITAL |
----------+-------------+----------+-------------+
000000001 | 2010:03:04 | 0000011 | PANTROMANI |
----------+-------------+----------+-------------+
000000002 | 2010:03:01 | 0001000 | ELLOUQUIER |
(i'm working with Mysql but i guess it should not be so different with any Database System)