Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Select and Total
Message
From
21/07/2003 11:29:34
Cindy Winegarden
Duke University Medical Center
Durham, North Carolina, United States
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00811985
Message ID:
00812023
Views:
12
>>SELECT invnum, name, SUM(qty) AS qty FROM table GROUP BY Invnum+Name INTO cursor cursorname
>
>This give me the folowing error:
>"SQL: GROUP BY clause is invalid."
>
>It appears that I can not use more than one field in the group by clause. Is this correct?

Hi Einar,

The SQL needs to be
SELECT invnum, name, SUM(qty) AS qty ;
    FROM table ;
    GROUP BY Invnum, Name ;
    INTO cursor cursorname
You must list every field in the GROUP BY that is listed in the SELECT, excepting aggregates such as SUM() or COUNT().
Previous
Reply
Map
View

Click here to load this message in the networking platform