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.comICQ #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.