</ Hi,I have a scenario where we have to match the record based on the highest value of sequence matched in 2nd table.
In the 1st table I have 5 rows and in 2nd table I have corresponding matching records .for an example in 1st table I have a record with Value 123456789 but in 2nd table I can have values like ,
1
12
123
1234
12345
So in this case the last value which is matching the most letters should match and get the result output...The output expected:
123456789 -> 12345
Below is some example and expected output required:
TABLE_1
COL_1
123456789
195678434
114678900
456789800
112332456
TABLE_2 | ||
---|---|---|
COL_1 | NAME | |
1 | A | |
12 | B | |
123 | C | |
1234 | D | |
12345 | E | <- This should match because max character is matching in a sequence |
1956 | A | |
195678 | B | <- This should match because max character is matching in a sequence |
1146 | A | |
11467 | C | <- This should match because max character is matching in a sequence |
4567 | A | <- This should match because max character is matching in a sequence |
112332456 | E | <- This should match because max character is matching in a sequence |
EXPECTED OUTPUT | |
---|---|
COL_1 | NAME |
123456789 | E |
195678434 | B |
114678900 | C |
456789800 | A |
112332456 | E |