Search
 
SCRIPT & CODE EXAMPLE
 

SQL

mysql count grouped rows

SELECT DISTINCT my_field, COUNT(*) FROM my_table GROUP BY my_field;

-- Count of grouped rows:
SELECT COUNT(*) FROM (
  SELECT DISTINCT my_field FROM my_table
);
Comment

PREVIOUS NEXT
Code Example
Sql :: sql server find all foreign keys that reference a column 
Sql :: Sql query to force the database to be drop 
Sql :: show databases mysql docker 
Sql :: oracle cpu per session 
Sql :: mysql get yesterday 
Sql :: mysql get db name 
Sql :: alter sequence set current value oracle 
Sql :: SQL Integer devision 
Sql :: update left join mysql 
Sql :: postgres drop column if exists 
Sql :: show table status command in mysql 
Sql :: set statiscis on in sql server 
Sql :: oracle alert log location 
Sql :: Odoo Service is not coming up with postgresql read replica (slave) 
Sql :: sql get user account 
Sql :: postgresql show current database 
Sql :: wordpress change user password sql 
Sql :: scaffold npgsql net core 
Sql :: mysql f# examples 
Sql :: how to connect mysql with specify port thorugh cmd 
Sql :: xampp mysql database server is not starting mac m1 
Sql :: async await mysql nodejs 
Sql :: update data with random values postgres 
Sql :: sql select contem uma palavra 
Sql :: sql server check table exists 
Sql :: delete all table oracle 
Sql :: sqlite check if row exists 
Sql :: alter table sql 
Sql :: mssql last day of month 
Sql :: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Public Key Retrieval is not allowed 
ADD CONTENT
Topic
Content
Source link
Name
9+3 =