I have table called PRODUCTDATA which has the following data
![PRODUCTDATA Table]()
I'm querying PRODUCTDATA from UI by using a combination of search string for example if a user searches using P1,ET,ML then the SQL query should search in all columns for possible combinations of P1,ET,ML in any order then it should fetch 20 as Product Units however if a user searches table using TT,KK,ET , SQL query should search all columns for all possible combinations and find the best possible match like ET is present so should fetch 26 as product Units .
Please suggest a way to handle this
Furthermore, you should also mention the version of the SQL Server you are using. In absence of one, most expert would assume that it is the latest which you may not be targeting.
In any case, here is script I came up with loads of gymnastics, may be there experts out there would probably give you more concise and elegant solution:
Open in new window