Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR 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
);
 
PREVIOUS NEXT
Tagged: #mysql #count #grouped #rows
ADD COMMENT
Topic
Name
6+8 =