Wednesday, November 20, 2013

Retrieve rows from a table where part of the text in a column field matches the text from another table

There are a couple of different ways of doing this but I do not think you will be getting 100% accurate results until you split your Full Name to First, Middle & LastNames. But, to start with to get a sense of how good or bad the design is look for the below query.



SELECT * FROM tblFullName FN
JOIN tblLastName LN
ON FN.FullName LIKE '%' + LN.LastName

GO



Hope this helps...............



Ione


No comments:

Post a Comment