I have two table called TableA and TableB. Here I need to match the TableB records from TableA.
I need to find the matching records from TableB in TableA
Well, technically, many of those do not match. w.astronecollege.com and ww.astronecollege.com are different more than just whether or not one has http:// or https:// in front. The others, you could simply use SUBSTRING to strip the leading characters off. Note though, that will result in slow performance in a query. That takes care of the ones that match, except for the inclusion of the URL definition. The issue is, what about the ones that absolutely do not match such as firki.com and http://www.firki.co?
The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood... Theodore Roosevelt
The Scary DBA Author of: SQL Server 2022 Query Performance Tuning, 6th Edition and SQL Server Execution Plans, 3rd Edition
Product Evangelist for Red Gate Software
The problem I see as Grant Fritchey allued to is that you have not defined what you mean by matching data. I mean I can eyeball what you have presented a simply say there are no matching records because you did not say what your matching criterion is and as such I would match field with field they would all fail.
Now however if you are saying what you are trying to match is, as Grant suggested, a substring then you need to clearly define the business logic for that substring as we could make guesses on our side as to what that means but without clearly defined business rules we would be shooting at a target in utter darkness.
Always know your data in totallity before you decide to work on it, otherwise you will constantly be re-engineering things which usually uses twice to five times as much effort.
Viewing 3 posts - 1 through 2 (of 2 total)