Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Query assistance
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01108620
Message ID:
01108856
Vues:
13
>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)
>>
>>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform