Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Select and Total
Message
De
21/07/2003 11:29:34
Cindy Winegarden
Duke University Medical Center
Durham, Caroline du Nord, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00811985
Message ID:
00812023
Vues:
13
>>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().
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform