Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GROUP BY clause difference between VFP & MSSQL
Message
 
 
À
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:
00416697
Vues:
26
No, I meant AGGREGATE functions, not functions like TOP. 'First' on some SQL servers means 'first row from group', last - 'last row from group'. Thus you can use VFP-style grouping, but because requirement to put all fields into aggregate function use 'first' or 'last' for all fields that are not really calculated.

>>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
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform