Hi all,

I have two tables in a database. Both have columns named "Company Name".
I want to compare between these columns for any similarities in their names.

For Example : Table1.CompanyName = 2i Ltd /// Table2.CompanyName = 2i Limitied.

Thanks

Gilbert

I want to compare between these columns for any similarities in their names.

Define similarities. A query cannot guess what the eye can easily distinguish as similar. So you need to define clear rules.

You could also limit it to the first x number of characters and check them against each other but Pritaeas is correct you will have to define some rules to go by. A query that would find your similar names would be:

where Left(Table1.CompanyName, 4) = left(Table2.CompanyName, 4)
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.