how to splitting a word from one column into another column
i have a table in sql server like > location > ---------- > chennaitamilnaduindia > trivendamkerlaindia my Expected output > city state country > chennai tamilnadu india > trivendam kerla india can any one know the answer?
The problem you're facing is that there is nothing from which to work the split function. Since everything, city, state, country, is all in a single string with no breaks, you're going to have a very hard time splitting it apart. The best I can come up with is a suggestion to get a list of city, state, and country, and then do a JOIN to that list with a LIKE function to find the pieces. But, that's going to hit issues if there's ever a city named Kerla as well as a State named Kerla (just picking an example).