Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Query assistance
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01108620
Message ID:
01108856
Views:
11
>Fabio,
>Thank you very much for another solution. It worked as I expected it to work.
>It took me a little bit longer to read (i.e. comprehend) your solution compared to Segey's solution. Would you care to comment on which solution you think is "better", yours or Sergey's?
>
>Thanks,
>Einar
>

If you have to project all the Table, GROUP ( Fabio's ) solution should to be better,
for a single
fk
the WHERE ( Sergey's )selection should to be.


>>
>>
>>SELECT Table.*
>>  FROM Table
>>	JOIN (SELECT fk,MIN(date) mind,MAX(date) maxd FROM Table GROUP BY fk) X
>>		ON X.fk=Table.fk AND Table.date IN (X.mind,X.maxd)
>>
>>
Previous
Reply
Map
View

Click here to load this message in the networking platform