Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Group By
Message
De
20/04/2009 18:38:39
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, États-Unis
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Group By
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01395684
Message ID:
01395684
Vues:
127
I'm having a group by brain-fart. Somebody please point me in the right direction...

I have the following data:
ID|FK|Status|StartDate
1|1|Started|1/1/2008
2|1|Finished|1/2/2008
3|2|Started|3/2/2008
4|3|Started|5/1/2008
5|3|Finished|5/4/2008
This is a transactional flow of items through statuses. I would like to see what status each item is currently set to, which should be the greatest StartDate. In my example, I want to see:
FK|Status
1|Finished
2|Started
3|Finished
Thanks in advance!
Very fitting: http://xkcd.com/386/
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform