SQL 2008 - Identify like data

Hi all,

I have two tables that i am performing left joins on.  My problem is that most of the data in the two fields i am trying to match on are the same, but there are some instances when the data is not exactly alike but similar.

For example

Table 1's field data:
1.5% 10
Cash Option
Net 45 days from INV

Table 2's field data:
1.5% 10
Cash Option
Net 45


The problem is that "Net 45" and "Net 45 days from INV" mean the same thing.

The query i am trying to write looks like the following:

Select *
from Table1 c
left outer join Table2 pt ON Table1 = c.id = pt.id
left outer join Table3 ar ON pt.discount = ar.Disc AND
pt.percent = ar.percent AND
pt.days = ar.days AND
pt.desc = ar.desc  ---My issue is here.  
           
Can i use a like clause or contain clause here because the SOME of the data does not match exactly, but most of it does?

Any suggestions on how to write this query?
MoreThanDoubledAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

HainKurtSr. System AnalystCommented:
try like

pt.desc like ar.desc  + '%'

or other way

ar.desc like pt.desc + '%'
0
HainKurtSr. System AnalystCommented:
or use CharIndex

(CHARINDEX(ar.desc, pt.desc)>0 or CHARINDEX(pt.desc, ar.desc)>0)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
HainKurtSr. System AnalystCommented:
I guess we need or in "like" too

( pt.desc like ar.desc  + '%' or ar.desc like pt.desc + '%')
0
MoreThanDoubledAuthor Commented:
Thanks!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Query Syntax

From novice to tech pro — start learning today.