Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Only return 1 row for join
Message
From
16/01/2013 08:57:12
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
01562935
Message ID:
01562951
Views:
27
>>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform