Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Data Fields Containing Wildcards?
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

2 Posts

Posted - 05/08/2013 :  08:35:41  Show Profile  Reply with Quote
I have a data table that has text data fields that contain wildcards? How can I join 2 tables on a query like;


FROM Table1


ON Table1.Field1 = Table2.Field1

So if Table1.Field1 contains ‘318A__3’ and Table2.Field1 contains ‘318A003’ it would match and the query would return ‘318A003’ along with all the other fields in that record from both tables.
The 5th and 6th position of Table1.Field1 in this example have the underscore but it may not always be in the 5th and 6th position.

James K
Flowing Fount of Yak Knowledge

3873 Posts

Posted - 05/08/2013 :  09:04:36  Show Profile  Reply with Quote
change the join condition to
Table2.Field1 LIKE Table1.Field1
Go to Top of Page

Starting Member

3 Posts

Posted - 05/08/2013 :  09:32:56  Show Profile  Reply with Quote
If you can share more information. So I can understand more comprehensive, I hope you getting better and better

Go to Top of Page

Starting Member

2 Posts

Posted - 05/09/2013 :  21:21:53  Show Profile  Reply with Quote
Yes using LIKE instead of = worked
Go to Top of Page
  Previous Topic Topic Next 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.02 seconds. Powered By: Snitz Forums 2000