How to match columns in MySQL

Everyone knows the "=" sign.

SELECT * FROM mytable WHERE column1 = column2;

However, what if I have different content in columns1 and column2 ... but are they VERY similar? (maybe turned off by a space or have another word).

Is it possible:

SELECT * FROM mytable WHERE ....column matches column2 with .4523423 "Score"...

I think this is called fuzzy matching? Or pattern matching? This is a technical term for him.

EDIT: I know about Soundex and Levenstein disatance. Is that what you recommend?

+3
source share
2 answers

What you are looking for is called Levenshtein distance . It gives you a numerical value that determines the difference between two lines.

MySQL . articla, .

+5

, . , .

, , - , Python. ( - "python", , Python...)

ORM Python, Python , Python . , Python Levenstein - .

ORM Python, , SQLAlchemy. ORM Django ; , . ORM , ORM Django . , SQLAlchemy.

!

0

Source: https://habr.com/ru/post/1720218/


All Articles