Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GROUP BY clause difference between VFP & MSSQL
Message
From
14/09/2000 19:34:35
 
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00416688
Message ID:
00416695
Views:
28
>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform