Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Group by question
Message
De
11/07/2005 20:48:10
 
 
À
11/07/2005 20:25:28
Information générale
Forum:
ASP.NET
Catégorie:
Bases de données
Divers
Thread ID:
01031432
Message ID:
01031449
Vues:
25
Thats a very good question, and I need to ask the person I'm asking this on behalf of, though I'm interested in the answer too. I guess that the correlated subquery is the only way to go.

Mike
>For these types of queries, you need to use a correlated sub-query. But as Kevin asks, what about the minimum price occuring on multiple dates?
>
>PF
>
>>lets say you have a stock file that has :
>>stock_id, date, price and you want to find for each stock the
>>minimum price and the date on which that price occurred.
>>
>>you can't use
>>select stock_id, date, min(price)
>> from stock
>> group by stock_id
>>
>>because sql requires you to use every non aggregate field
>>in the group by. any ideas?
>>Oh this is in SqlServer and Postgresql
>>
>>Mike
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform