MYSQL PHP: Find duplicates based on Address Column

  duplicates, laravel, mysql, php, search

I have an addresses table in my MYSQL database with the following structure:

  • The first column ID, is a primary, auto-increment column.
  • The second column Name is varchar.
  • The third column contains address (text), filled by user.
  • The forth column contains address slug, which is basically the address (Third Column) in lower case and without any special characters.
  • The last column contains the creation date of the record.

enter image description here

I wish to display all the records and highlight the possible duplicates, based on the address/address slug.

In this case, the duplicates are as follows:

  • Record 1 and Record 2
  • Record 3 and Record 6

Is there a way to partially match a string in MYSQL or PHP, to achieve the above results?

FYI: I have gone through SPHINX PHP, SQL FULLTEXT SEARCHES etc.

I have been struggling over 2 weeks, but couldn’t find any optimal solution.

Any ideas, suggestions, solutions are welcome.

Source: Laravel StackOverflow

Leave a Reply