Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GROUP BY clause difference between VFP & MSSQL
Message
De
14/09/2000 19:34:35
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00416688
Message ID:
00416695
Vues:
30
>Are there aggregate functions for MS SQL Server like 'First' or 'Last'?
>

There is TOP, MAX() and MIN() just like in VFP.

For First
SELECT TOP * FROM table ORDER BY field1

For Last
SELECT TOP * FROM table ORDER BY field1 DESC

MAX() and MIN() - using pubs database
SELECT stor_id, MIN(qty) AS min_qty, MAX(qty) AS max_qty 
  FROM sales
  GROUP BY stor_id
Insanity: Doing the same thing over and over and expecting different results.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform