M
M
masterwen2019-10-13 19:43:44
SQL
masterwen, 2019-10-13 19:43:44

SQL output the number of identical values?

There is a table
Ban| banana| login
12| 12| master
1 | 5 |master
2| 3| kiril
6|8|maksim
5|3| MASTER
how to output for example the number of master in the code?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
Gleb Varganov, 2019-10-13
@kores

SELECT COUNT(*) FROM `table_name` WHERE `login`='master'

here is an example on my table:
5da3559d248a8851018617.png

F
FanatPHP, 2019-10-13
@FanatPHP

select login, count(*) cnt from таблица group by login having cnt > 1 order by cnt desc

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question