0
Something like that:
SELECT t.acertou,
COUNT(1)
FROM tabela t
GROUP BY t.acertou
If you wanted to show as just a record, you can use subquery
:
SELECT (SELECT COUNT(1)
FROM tabela t
WHERE t.acertou) AS acertos,
(SELECT COUNT(1)
FROM tabela t
WHERE NOT t.acertou) AS erros
show.... worked here... but how do I catch each one in a column?
– Thiago Cunha
@Thiagocunha depends, you want to filter by student or how you want to do it? All at once?
– Sorack
needed only 2 columns... 1 showing the amount of hits, and another, with the amount of errors...
– Thiago Cunha
@Thiagocunha changed the answer based on his doubt
– Sorack
TOP! Thanks even! It worked perfectly!
– Thiago Cunha
Just one more question based on your doubt about the execution. If I want to pick grouped per student? That is, show: qtd_erros_student, qtd_student rights_student
– Thiago Cunha
@Thiagocunha then the answer would change radically. If you want to ask another question with this doubt I can come up with a
query
that answers– Sorack
https://answall.com/questions/299105/query-para-pegar-erros-e-acertos-de-um-aluno
– Thiago Cunha