-
Query Help
Hello all
I am having a problem and I hope you guys could help me with it. Essentially, I have to create a query. This essentially what my db tables look like.
----------------
| Name | Status|
----------------
|First | 1 |
|First | 2 |
|Second| 3 |
|Second| 2 |
|Third | 1 |
----------------
From this table, I have to get the following table:
--------------------------------------------
|Name |Count Total|Count 1|Count 2|Count 3|
--------------------------------------------
|First | 2 | 1 | 1 | 0 |
|Second| 2 | 0 | 1 | 1 |
|Third | 1 | 1 | 0 | 0 |
--------------------------------------------
Here, "Count Total" is the total number of entries for each name, "Count 1" is the total number of entries with the Status 1 for each name, "Count 2" is for status 2, and so on.
I have a feeling that this quiry can be done fairly easily, but I cannot envision it. Any help you guys could give would be great.
Thank you in advance.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|