Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I get just the latest edit dates
Message
De
21/03/2005 13:00:27
 
 
À
21/03/2005 12:58:11
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00997819
Message ID:
00997899
Vues:
9
If all you want is the latest dates, follow Sergey's example. If you mean you want the most recent date for a specific part, you need to follow this example:

You need to do what's called a "correlated sub-query". I haven't done one in a few, so If I make a mistake in this example, I'm sorry but it's something like:

Select location, part, editdate from inventory A where editdate = (select
max(editdate) from inventory B where b.part = a.part and b.location = a.location)

Pf
>
>>IF I wanted to just get the latest edit dates from a table
>>
>>i.e.
>>
>>select location, part, editdate
>>Form inventory
>>
>>How would I just get the records from the most recent editdate?
>>
>>Thanks
>>Jim

(On an infant's shirt): Already smarter than Bush
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform