Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GROUP BY 1 no longer works
Message
De
17/02/2003 13:29:53
 
 
À
17/02/2003 11:27:13
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00750415
Message ID:
00754179
Vues:
26
>I see the problem clearly regarding DISTINCT. Not so with GROUP BY, but I take your word for it.

Jim - did you run the GROUP BY example? Try this query first:
OPEN DATABASE HOME(2)+"TasTrade\Data\TasTrade"
SELECT customer_id, order_date, freight ;
   FROM orders ;
   ORDER BY 1 ;
   INTO CURSOR fullresult
Then run the one I posted:
OPEN DATABASE HOME(2)+"TasTrade\Data\TasTrade"
SELECT customer_id, MAX(order_date), freight ;
   FROM orders ;
   GROUP BY 1 ;
   INTO CURSOR result
If you look, you'll see that the Freight field in Result comes from the last record for each customer in date order. Oh, bad example, change MAX() to MIN() and you should get the point.

Tamar
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform