Hi,
I have a master table which has 2 columns i.e. Codata and Keyword, below:
CoData -------------------------------------------- KeyWord
BBNRM PRE UNIVERSITY COLLEGE FOR WOMEN ------------ UNIVERSITY
NOVOFLEX MARKETING PRIVATE LIMITED ------------ MARKETING
RAY LOGISTICS SERVICES PRIVATE LIMITED ------------ LOGISTICS
MANDAR LEARNING ACADEMY PRIVATE LIMITED ------------ LEARNING
REMINCO RESOURCES PRIVATE LIMITED ------------ RESOURCES
The keyword is just a split word of the Codata string.
What I am trying to achieve, two outputs:
OutPut1
PRE UNIVERSITY
NOVOFLEX MARKETING
RAY LOGISTICS
MANDAR LEARNING
REMINCO RESOURCES
Output2
UNIVERSITY COLLEGE
MARKETING PRIVATE
LOGISTICS SERVICES
LEARNING ACADEMY
RESOURCES PRIVATE
The first output is the concatenation of the keyword along with the immediate previous word of the keyword in the codata string.
Similarly, The first output is the concatenation of the keyword along with the immediate next word of the keyword in the codata string.
I tried achieving this through the combination of substring and charindex but the output was not as expected.
Request to please advise.
Thanks,
Rakesh
I have a master table which has 2 columns i.e. Codata and Keyword, below:
CoData -------------------------------------------- KeyWord
BBNRM PRE UNIVERSITY COLLEGE FOR WOMEN ------------ UNIVERSITY
NOVOFLEX MARKETING PRIVATE LIMITED ------------ MARKETING
RAY LOGISTICS SERVICES PRIVATE LIMITED ------------ LOGISTICS
MANDAR LEARNING ACADEMY PRIVATE LIMITED ------------ LEARNING
REMINCO RESOURCES PRIVATE LIMITED ------------ RESOURCES
The keyword is just a split word of the Codata string.
What I am trying to achieve, two outputs:
OutPut1
PRE UNIVERSITY
NOVOFLEX MARKETING
RAY LOGISTICS
MANDAR LEARNING
REMINCO RESOURCES
Output2
UNIVERSITY COLLEGE
MARKETING PRIVATE
LOGISTICS SERVICES
LEARNING ACADEMY
RESOURCES PRIVATE
The first output is the concatenation of the keyword along with the immediate previous word of the keyword in the codata string.
Similarly, The first output is the concatenation of the keyword along with the immediate next word of the keyword in the codata string.
I tried achieving this through the combination of substring and charindex but the output was not as expected.
Request to please advise.
Thanks,
Rakesh