Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

mysql multiple count

select count(*) as total_count,
count(if(product='A',1,null)) as A_count,
count(if(product='B',1,null)) as B_count
from product_sales;
 
PREVIOUS NEXT
Tagged: #mysql #multiple #count
ADD COMMENT
Topic
Name
4+8 =