Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL SELECT and COUNT - how?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
SQL SELECT and COUNT - how?
Miscellaneous
Thread ID:
00113907
Message ID:
00113907
Views:
49
I have a table with 4 fields of interest: user_id, user_source, task_id, subTask_id. I would like to know things like how many users (user_id) from each source (user_source) used each task (task_id), and how many users (all sources) used each sub task (subTask_id). I do not want to count duplicates (the same user_id using the same subTask_id for example). The output should be a cursor showing each user_source, the subTask_id, and the number of users from that source who used this subTask_id. For example:

Source_ID sub_ID num_Users
1 2 15
1 3 25
2 2 19

and so on ...

I know I can do this the hard way by using variables and incrementing counters, but how can I do this using SQL SELECT and COUNT?

Mon
Next
Reply
Map
View

Click here to load this message in the networking platform