I have a below column values in a table
Destination
DELLKO
DELBOM
DELVGA
BOMIXY
and so on
and another table with the following data
Table name -- CITY
CityName Code
Agartala IXA
Agatti AGX
Agra AGR
Akola AKD
Allahabad IXD
Aurangabad IXU
Siliguri IXB
Bareilly BEK
Lucknow LKO
DELHI DEL
BOM MUMBAI
and so on
now I would like the output something like that
DELHI|Lucknow
DELHI|MUMBAI
whith the help of Table CITY i.e. wherever destination column has DEL it should be replace by DELHI append pipe sign and search LKO and append LUCKNOW.
left(Destination,3)andright(Destination,3)withCITYtable (2 different joins)?'BOM'/'MUMBAI'row in tableCITY? Might it have the column values swapped?