SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Using LIKE Pattern matching for joining tables
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

vision.v1
Yak Posting Veteran

71 Posts

Posted - 11/12/2012 :  04:56:25  Show Profile  Reply with Quote
Hi,

I would like to join two tables based on fields of varchar() types

The difference here is that this 'ON' condition will not be a conventional one like this

SELECT * from
TABLE_A as A
inner join TABLE_B as B
on A.Col=B.Col

Instead I want to be a join based on pattern matching

SELECT * from
TABLE_A as A
inner join TABLE_B as B
on A.Col LIKE 'B.Col%'


Please Advise.

webfred
Flowing Fount of Yak Knowledge

Germany
8683 Posts

Posted - 11/12/2012 :  05:27:32  Show Profile  Visit webfred's Homepage  Reply with Quote
on A.Col like B.Col + '%'


Too old to Rock'n'Roll too young to die.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000