Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL query
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01001558
Message ID:
01001561
Vues:
15
Try
SELECT SalesmanID, SUM(Total) AS Sales, COUNT(*) AS Orders ;
  FROM mytable ;
  GROUP BY 1 
>This should be an easy SQL statement but I cannot figure out how to do it.
>
>I have a table with sales summary info to keep it simple
>
>
Inv_Date   Date
>Total      N10.2
>SalesmanID C5
>
>I want to create an sql statment that sums each salesman's sales and count's the number of orders to a cursor/table.
>
>So my resulting table would look like:
>
>
Salesman     Sales    Orders
>MCMW       210,382        14
>ALCS       155,417        12
>PCKD       120,232         8
>
>I do some SQL but not none that generates summary info. Can I do this in SQL, or do I need to do it the old fashioned way?
>
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform