MYSQL Query for similiar data in multiple columns -
+-----------+----------+-----------+----------+ | contactid | fullname | firstname | lastname | +-----------+----------+-----------+----------+ | c01 | ash das | ash | das | | c02 | abhi das | abhi | das | | c01 | ash das | ash | ah | +-----------+----------+-----------+----------+ from above table need wite query provide similiar names table. can match frstname, lastname fullname. you may soundex function advised performances not optimal because indexes can't used mysql server kind of string functions. for example if fullname select c1.contactid,c1.fullname, c2.contactid, c2.fullname <contacttable> c1 inner join <contacttable> c2 on (c1.contactid != c2.contactid , soundex(c1.fullname) = soundex(c2.fullname))