MySQL
- 3 ответа
- 0 вопросов
1
Вклад в тег
`phone1` LIKE "%7(909)6060567%" OR `phone2` LIKE "%7(909)6060567%"
SELECT *
FROM (
SELECT p1.num, p2.num
FROM profil p
OUTER APPLY (SELECT REPLACE(REPLACE(REPLACE(REPLACE(p.phone1,'-',''),')',''),'(',''), ' ','') as num ) p1
OUTER APPLY (SELECT REPLACE(REPLACE(REPLACE(REPLACE(p.phone2,'-',''),')',''),'(',''), ' ','') as num ) p2
) number
WHERE `p1` LIKE "%9096060567%" OR `p2` LIKE "%9096060567%"
SELECT *
FROM (
SELECT TOP 10 ABS(100 - result) as diff
FROM t
WHERE side = 'bright') b
WHERE diff < 20