ione ione - 29 days ago 6
SQL Question

how to count total as type in database?

i have table like this

enter image description here

I want to calculate the amount of data using the column, for example in the last column type "poc" totaling 3,so i want create query where result type "poc" result 3.
how to count total as type in database?

Answer

I think you want group by:

select type, count(*)
from t
group by type;