I have the following SQL procedure/select statement that I am working on modifying. I derived this from a previous question I had which can be referenced here: Need help with SQL query

This works pretty good when I do not have the conditional in there checking for years of experience, but I actually want to modify this so that if I have a list passed in @csvList and another list of @csvYears, then I can pair the values - that is, I can search for Skill1 with 5 years of experience, and Skill2 with 3 years of experience.

Can I just do another JOIN on the table of csvYears? (The SplitCSVStrings function returns a table, and splits the CSV list of values)

How can I modify this to allow me to search for a different condition for each of the skills? @csvList is coming in like "C++, Java" and I want @years to come in as "5, 3" and the corresponding search to show me people that have 5 years of C++ experience, and 3 years of Java experience.

1 Answer
1

I think that you need to modify the function SplitCSVStrings for this to work. Yo should make it so the table that it returns has one extra column indicating the position in the csv. For example, if the parameter is "C++, Java", the result should be: