February 26, 2019 at 3:43 pm
Hi,
I was hoping someone could please help me.... I am using TSQL and was aiming to be able to be able to complete my query by completing the set of partial strings. I have inserted a sample of what I needed to do (see image). Initially, I only have the column names: "Partial Strings" and I have a separate Table named "Lookup List". Limitations are:
1. No other objects to be used as their unique identifier.
2. "Partial Strings" have no specific number of characters, and can appear in as little as 2 first characters
February 26, 2019 at 5:45 pm
Don't think it will work unless the first 2 characters of a the strings are unique, so you wouldn't have something like
Ball
Bath
as members of the set. If that's the case, that solution won't work.
February 27, 2019 at 6:33 am
The first 2 characters is always unique in my data set...
February 27, 2019 at 6:49 am
carminamae.gonzales - Wednesday, February 27, 2019 6:33 AMThe first 2 characters is always unique in my data set...
If you have a number of characters that a string begins with, to find that string on the database you just need a query using like.
e.g:SELECT *
FROM dbo.[Given List] g
INNER JOIN dbo.[Separate Table] t
ON t.[Lookup List] LIKE g.[Partial String] + '%'
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy