Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Query help needed
Message
From
18/02/2010 00:34:24
 
 
To
18/02/2010 00:28:58
Deepak Chopra
IBM Global Services India Pvt. Ltd.
Pune, India
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01449644
Message ID:
01449645
Views:
59
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.
Previous
Reply
Map
View

Click here to load this message in the networking platform