From this table
D_value ------- A B B C C C
To display count D_Value into this table
A | B | C --------- 1 | 2 | 3
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To get a single row, use this.
This works for a finite and fixed number of values to count
If you do not know how many different values, then you need to do a simple aggregate and make a single row in the client code.
However, this won’t give zero counts for values that do not exist. So you’d need a lookup table and LEFT JOIN. I won’t go there yet…