Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Only return 1 row for join
Message
De
16/01/2013 08:57:12
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01562935
Message ID:
01562951
Vues:
28
>>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
Fil
Voir

Click here to load this message in the networking platform