Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Select and Total
Message
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:
00811987
Vues:
11
>Assume this table:
>
>invnum    name    qty
>------    ----    ---
>001       AA        2
>002       AA        3
>001       BB        1
>001       AA        5
>002       BB        6
>001       CC        7
>
>
>Currently I issue a SQL select like this:
>
>
>select * from myTable where invnum=="001" into cursor myCursor readwrite
>
>then I use the TOTAL command on myCursor to get the folowing result:
>
>
>invnum    name    qty
>------    ----    ---
>001       AA        7
>001       BB        1
>001       CC        7
>
>
>My question is: Is there any way to incorporate the total command into the SQL select statement to output the desired totaled table?
>
>Any help/comments are appreciated.
>
>Einar

SELECT invnum, name, SUM(qty) AS qty FROM table GROUP BY Invnum+Name INTO cursor cursorname
Bret Hobbs

"We'd have been called juvenile delinquents only our neighborhood couldn't afford a sociologist." Bob Hope
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform