Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Count customer
Message
 
 
À
25/11/2002 23:05:24
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00726794
Message ID:
00726798
Vues:
18
>i have a table that has 2 coulms one is order date and the other is customer id i want to know how many orders a customer did with out cuonting more than one order per day for example if in one day he hs more then one order i want to count only one i did select ord_date,cus_id from my table group by 1,2 and i still get more than one record for a custumer per date

Try
* Eliminate day duplicates
SELECT DISTINCT OrderDate, CustomerID ;
  FROM table1 ;
  INTO CURSOR crsTemp
* Count orders
SELECT CustomerID, COUNT(*) ;
  FROM crsTemp ;
  INTO CURSOR crsResult
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform