A
A
arruah2016-11-13 10:24:56
MySQL
arruah, 2016-11-13 10:24:56

How to make a select to select fields where there are more than 3 single characters?

It is required to select all rows from the table in which one of the fields contains more than three identical characters.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
mletov, 2016-11-13
@arruah

If we are talking about a specific character, for example, a point
www.sql.ru/forum/430173/kolichestvo-vhozhdeniy-pod...
If I understand correctly "Now you need to find more than 3 points in the field."

SELECT *
FROM table
WHERE  ( (LENGTH(field) - LENGTH(REPLACE(field, '.', ''))) / LENGTH('.') ) > 3

Z
Zhainar, 2016-11-13
@zhainar

dev.mysql.com/doc/refman/5.7/en/regexp.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question