Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Count in SELECT-SQL
Message
 
 
À
02/10/2000 09:36:26
Fida Shamsoodeen
Combined Systems (Pty) Ltd
Centurion, Afrique du Sud
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00423386
Message ID:
00423398
Vues:
20
Try something like:
select department.dept, category.categ, count(assets.categ) as 'Cnt' ;
   from department, category, assets ;
   where department.dept = assets.dept and category.categ = assets.categ ;
   group by department.dept, category.categ
HTH.

>Hi All
>
>Please help with this problem.
>I have 3 tables :
>1. Assets
>2. Category
>3. Department
>
>I wish to create a query that does the following :
>It shows for e.g. in department 1 i have 30 CPU's.
>It must show the count of each category but not the individual items
>
>Department 1, CPU's , 30
>Department 1, CD-ROM's , 12
>Department 1, Chairs , 5
>Department 2, CPU's , 11
>Department 2, CD-ROM's , 22
>Department 2, Chairs , 15
>
>Assets file MUST be linked to Department file and Category File
>Assets file has a field called Dept and department file has a field called Dept.
>Assets file has a field called categ and the category file has a field called categ.
>
>Thanks in advance
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform