I have the following table in SQL:
ID Descripcion Respuesta
1 Nombre1 True
2 Nombre2 True
2 Nombre2 False
2 Nombre2 False
1 Nombre1 True
And I want to get the following in one table:
Descripcion TotalRegistros RegistrosSI RegistrosNo
Nombre1 2 2 0
Nombre2 3 1 2
By means of this query I can obtain the total of Records
SELECT Descripcion, COUNT(ID) FROM Tabla GROUP BY Descripcion, ID //Por ejemplo
But I do not know how to add the other columns with data, I know that if I get the same total and total SI in the same table I can get the RegistriesNO, but I do not know how to generate it. Is there any way to have a subquery in the count for example?