A
A
Alexander Verbitsky2018-09-30 13:39:09
MySQL
Alexander Verbitsky, 2018-09-30 13:39:09

How to get the number of duplicate items in a database?

There is a table with flowers (on the left).
How to get the number of repetitions of each color in one query?? (table on the right)
5bb0a7734a166786453749.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2018-09-30
@VerbAlexVlad

Something like this:

SELECT `color`, COUNT(`color`) as `count` FROM `table` GROUP BY `color`;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question