Re: SQL Query help needed
Posted by:
Shreya P
Date: April 26, 2016 11:41PM
Thanks Mr.Peter Brawley,
I apologize, if I have not explained the requirement clearly.
It is not a school project.
I am doing a small project where I have to do the string comparsion between the source and the reference data. Each source record will have multiple recrods in the reference data.
For each product_name and the model there are multiple variants.
THis is my Refernce data (lookup)
"model", "variant"
"Blueline", "183 CY/A/E Series Split AC 1.5 Ton, 3 Star Rating, White"
"Blueline", "183 CY/A/E Series Split AC 1 Ton, 5 Star Rating, Black"
"Blueline", "183 CY/A/E Series Split AC 1 Ton, 5 Star Rating, Black"
"Blueline Premier", "193 CY/A/G Series Split AC 1.5 Ton, 5 Star White"
"Blueline Premier", "188 CG/A/Y Series Split AC 1.0 Ton, 5 Star Black"
Source info
"model", "variant"
"Blueline", "183 CY/E Series Split AC 1.5 White 3 Star Rating"
My requirement is to match only those records where the source model is "Blueline" and do the string comparison to narrow down and take the record where the string comparison score is highest. If I give the model like "Blueline%" then it will pull all the records starting with the values Blueline .." in such case my string comparison will happen on all the records where model names are like Blueline%. It will be time consuming as well as it may return the wrong variant based on the string compariosn score.
Regards
Shreya P