mysql count multiple columns in one query

Solutions on MaxInterview for mysql count multiple columns in one query by the best coders in the world

showing results for - "mysql count multiple columns in one query"
Jesús
27 May 2017
1SELECT
2	GROUP_CONCAT(DISTINCT id SEPARATOR ', ') AS 'ids'
3FROM
4	table_name
5WHERE
6	column_name = 'value'
Iban
11 May 2017
1mysql count multiple columns in one query:
2 SELECT 
3        count(*)             as count_rows,
4        count(col1)          as count_1,
5        count(col2)          as count_2,
6        count(distinct col1) as count_distinct_1,
7        count(distinct col2) as count_distinct_2,
8        count(distinct col1, col2) as count_distinct_1_2
9    FROM `table` ;
queries leading to this page
mysql multiple rows into one columnmysql where multiple columnsmysql get sum of multiple columns one querymysql count with other column valuesmysql query select multiple rowsget two rows in one query mysqlmysql select several columnsbest practice to count multiple column in single query mysqlmultiple row in single column mysqlselect multiple columns in mysqlselect multiple rows in mysqlmysql select multiple rows constant datamysql get multiple rows in onmysql multiple row into single rowmysql two rows into onemysql count multiple same columnsmysql select count of two relevant columnsmysql count with multiple columnsmysql count on multiple columnsmysql select multiple datamysql match multiple columnshow to get the count of 2 column in mysqlcount rows from multiple tables mysqlmysql select in select multiple columnscount of all records in with multiple column names mysql2 query in one row mysqlmysql select multiple rows into one column valuemysql count multiple columns in one querymysql select multiple rowsmysql select multiple rows into one columnmysql multiple query results in a rowmysql display multiple rows in one rowmysql get multiple rowsmysql select as multiple columnsmysql multiple 2 values in selectcount multiple columns in mysqlin in mysql on multiple columnsselect count two columns from same tables mysqlselect multiple values in mysql manuallymysql select count two columnscount of nulls for multiple columns in mysqlcount multiple column in mysqlhow to get count of elements from two columns in mysqlmysql count multiple values in one columnmysql multiple values in one columnmysql select multiple columns from same tablemysql multiple rows to one columnmysql where one column multiple valuesselect multiple columns from different table mysqlview multiple coloumn in single query mysqlhow to select data from 2 columns in mysql sql set update with count multiple columnsmysql get multiple rows in on rowmysql query select multiple columns in 1 rowmysql select row multiple timesmysql count 2 columnsmysql query select multiple columnsmysql count two columnswhere in multiple columns mysqlmysql where in multiple columnsmysql count multiple columnsmysql check multiple columns for valuemultiple values in one column mysqlmysql select multiple columns with one dismysql one column multiple valueshow to select multiple columns mysqlmysql select 2 rows when theres 2 datatwo query in one mysql with multiple rowsmysql select multiple values in same columnmysql select multiple columnsmysql 2 columns for multiple valueshow to get the total number of a values in multiple columns in mysqlselect multiple column in sub query mysqlmysql select multiple columns and insertmysql select count multiple columnsselect count on multiple columns using case condition mysqlmysql where multiple values for the same columnmysql combine multiple rows into multiple columnsmysql count number of records with same columncount multiple value from same column in mysqlmysql having count multiple columnsselect multiple rows mysqlselect only one row when same values with multiple rows in mysqlmysql multiple where same columnmysql multiple columns in one rowmysql count multiple columns with multiple conditionmysql having multiple columnsmysql sql sum the count of two columnsmysql select multiple valuesget sum of multiple columns in mysqlcan we pass two columns in count in mysqlselect with multiple values mysqlhow to get count of multiple columns in sqlselect multiple values from mysql databasecount multiple values from same column in mysqlget column 2 count based on column 1 values mysqlmysql select multiple rows in 1 columnmysql multiple count with different columnsmysql count multiple columns in one query