May 2, 2014 at 8:30 am
I am trying to Join Two tables (A & B)
One of them has a value - IBM
another table has value IBM (Integrated)
Table A
Left Join
Table B
On A.DeviceType = B.DeviceDetail + '%'
But when I see the results
For table one I see IBM but Table B shows Null and so I cannot pull the required values.
May 2, 2014 at 8:40 am
Your question is a bit confusing and I'm not sure this is what you really want, however I think that LIKE is what you're looking for:
SELECT SomeColumns
FROM TableA
LEFT JOIN TableB
ON A.DeviceType LIKE B.DeviceDetail + '%'
-- Gianluca Sartori
May 2, 2014 at 8:43 am
My Bad, I am using The LIKE Operator. ( Typo)
May 2, 2014 at 8:50 am
No Worries , I figured it.
The join is the other way round:)
May 2, 2014 at 8:51 am
So is your query ok now or do you still need help?
--edit--
Seems you were posting at the same time I was. Glad you figured it out.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply