Information générale
Forum:
Microsoft SQL Server
>>Hi
>>
>>I can't remember how to do this.
>>
>>I have two tables with a join
>>
>>Table Contact has multiple rows for each row in table Individual.
>>
>>I only want to return the earliest row in table Contact for each row in Table Contact. Each row in table contact has a created date and they are joined on individual_ref
>>
>>How do I do that ?
>>
>>Thanks
>
>Some example data and desired result from it?
Ok
Table individual
Individual_ref
114817
table contact
contact_ref ORGANISATION_REF INDIVIDUAL_REF CREATE_TIMESTAMP
440490 1333 114817 2011-06-01 14:21:01.143
440491 13 114817 2011-06-01 14:21:13.477
447861 1418 114817 2011-08-24 12:17:52.810
232049 22 114817 2007-12-25 09:47:34.937
232050 1435 114817 2007-12-24 09:47:34.937
I only want to link to contact_ref 232050
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement