Search
 
SCRIPT & CODE EXAMPLE
 

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;
Comment

PREVIOUS NEXT
Code Example
Sql :: create table employees oracle 
Sql :: mysql replace string in table 
Sql :: select first and last row sql 
Sql :: download mysql 64 bit 
Sql :: delete row psql 
Sql :: ascending order mysql 
Sql :: how to show index type in postgresql 
Sql :: Postgresql get diff between two dates in Months 
Sql :: sql percentage with % rounded down 
Sql :: mysql disable query caching 
Sql :: mysql terminal run sql file 
Sql :: write pandas dataframe to postgresql table psycopg2 
Sql :: mysql failed to login as root@localhost 
Sql :: mysql copy table to another table 
Sql :: foreign key constraint in ms sql 
Sql :: postgres create column with default value 
Sql :: mysql two column combination unique 
Sql :: oracle apex charging debug 
Sql :: add colum date in sql 
Sql :: multiple like in sql 
Sql :: mysql money value 
Sql :: change data type postgresql 
Sql :: SQL UNION ALL Operator 
Sql :: mysql timestamp format 
Sql :: show query code after create table in sql 
Sql :: sql select where in 
Sql :: Converting mysql tables to charset utf8mb4 
Sql :: how to change db owner postgres 
Sql :: sql insert column 
Sql :: create table with index mysql 
ADD CONTENT
Topic
Content
Source link
Name
7+6 =