Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Summing on two fields in SQL
Message
 
 
À
30/05/2007 11:28:11
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01229336
Message ID:
01229341
Vues:
7
>Hi. I have a database with customer #'s and zip codes (among other things). How would I do a SQL to give me a report of unique zip codes and unique customer numbers within that zip code.
>
>I can get a listing with unique zips, but it gives me a count of all customers (not ignoring repeat customers).
>
>Thanks, Randy

Try
SELECT zip, COUNT(DISTINC customer) FROM mytable GROUP BY 1
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform