Oct 4, 2011 #1 ciarra41 Technical User Sep 11, 2006 116 US I trying to join two tables with table a has a single value whereas the table b may have multiple values but still has the value in table a. Possible easy fix? select a.* FROM tableA as a inner join tableB as b on b.CODE = LIKE '%'[a.code]'%'
I trying to join two tables with table a has a single value whereas the table b may have multiple values but still has the value in table a. Possible easy fix? select a.* FROM tableA as a inner join tableB as b on b.CODE = LIKE '%'[a.code]'%'
Oct 5, 2011 #2 r937 Technical User Jun 30, 2002 8,847 CA ON b.CODE LIKE '%' + a.code + '%' r937.com | rudy.ca Buy my new book Simply SQL from Amazon Upvote 0 Downvote
Oct 5, 2011 #3 Qik3Coder Programmer Jan 4, 2006 1,487 US And all together now: Code: Select a.* FROM tableA a JOIN tableB b ON b.Code LIKE '%'+a.Code+'%' Note this is expecting something like: a.Code[tab]b.Code AAA[tab]AAA BBB AAA[tab]CCC DDD AAA BBB[tab]EEE BBB DDD Lodlaiden You've got questions and source code. We want both! Upvote 0 Downvote
And all together now: Code: Select a.* FROM tableA a JOIN tableB b ON b.Code LIKE '%'+a.Code+'%' Note this is expecting something like: a.Code[tab]b.Code AAA[tab]AAA BBB AAA[tab]CCC DDD AAA BBB[tab]EEE BBB DDD Lodlaiden You've got questions and source code. We want both!