mysql - generate a query that show the times that questions get wrong -


i have table named countwronganswer columns cwa_id, question_num. how can generate table query shows 2 columns, 1 column lists question_num , second column lists number of times cwa_id related question_num.

question number |total # of mistake |  1                12 2                22 ..etc 

attention: question asked without awareness of existence of count or groupby method because of knowledge level @ state. count() or groupby() key generate 2nd column of total # values did not aware of completely, therefore, attempt, @ point of time, write code data close meaningless. vote if possible if think useful or resolved issue.

probably this

select question_num, count(cwa_id) total_mistakes   countwronganswer  group question_num 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -