mysql - search query count 1 field group by name -


I have a table that I am using in my query, but I think I can not find the expected result Maybe my query is wrong.

table attempt

  | ID | Name | Results | 1 | Paul | Passed | 2 | Paul | Passed | 3 | Paul | Unsuccessful 4 | John | Unsuccessful 5 | John | Passed  

should be the result

  name | Passed Unsuccessful Paul | 2 | 1 | John | 1 | 1 |  

But my results are 4 lines: I display my name twice.

This is my query

  SELECT name, SUM (result = "pass") AS passed, SUM (result = "failed") AS FROM failed results  

only remove the result SEM (result = "failed") as SEMs (result = "pass") as the cause in the name of the efforts by the Group of SAP (result = "pass")

< / Html>

Comments

Popular posts from this blog

python - rpy2 import is not working -

javascript - How to get MySQL query result returned using $.ajax -

c++ - How to load a bitmap from file into the samples buffer -