Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Query help needed
Message
De
18/02/2010 00:34:24
 
 
À
18/02/2010 00:28:58
Deepak Chopra
IBM Global Services India Pvt. Ltd.
Pune, Inde
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01449644
Message ID:
01449645
Vues:
60
Assuming all you want are counts by Department and by "Salary Type"...
select Dept, SalaryType, Count(*) as Tally from
    (SELECT Dept, CASE When Salary >= 60000 then 'Rich' else 'Poor' end as SalaryType
        from TableName)  As TempList
            GROUP BY Dept, SalaryType   ORDER BY Dept, SalaryType
where tableName is the name of the table

Note: I didn't test this code, as I don't have a table with that structure, but hopefully it will give you what you need.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform