A
A
Alexander2020-02-05 18:51:27
MySQL
Alexander, 2020-02-05 18:51:27

How to group the same phone numbers recorded in different formats?

Hi, tell me how to solve the problem
there is a table with phone numbers but they are written in different formats, they need to be grouped and counted
+70000000000
70000000000
+7(000)0000000

can somehow be grouped by the last 7 characters for example?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Sokolov, 2020-02-05
@unix0

SUBSTRING(phone, -3)
https://dev.mysql.com/doc/refman/8.0/en/string-fun...

D
Dmitry, 2020-02-05
@thewind

Replace the brackets and the plus sign at the beginning with an empty value and get a single format. Group by result. mysql has all string functions for simple purposes.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question