Hi,
I am trying to execute a select query, that will have concatenation of four columns.
I am not just interested in concatenating, but also interested in inserting a constant values between these concatenations.
Also i want to have a word in between, which is again concatenated.
[highlight #CC0000]INPUT DATA[/highlight]
A = Tom, Dick, Harry............
B = Maria, Lucie, Diana............
Constant 1 = Palm
Constant 2 = Beach
C = Mike, Ron, Carmen............
D = Mary, Cynthia, Alex...........
[highlight #CC0000]I am expecting a result as follows,[/highlight]
Row 1 = Tom.Maria.Palm.MikeMary.Beach
Row 2 = Dick.Lucie.Palm.RonCynthia.Beach
Row 3 = Harry.Diana.Palm.CarmenAlex.Beach
I know the regular concatenation query such as CONCAT(A,'.',B,'.',C). Since i have to insert some constant in between, i am getting confused. And also, there a COncatenation under a concatentaion.
Your help will be really appreciated. Thanks in advance.
Best!
I am trying to execute a select query, that will have concatenation of four columns.
I am not just interested in concatenating, but also interested in inserting a constant values between these concatenations.
Also i want to have a word in between, which is again concatenated.
[highlight #CC0000]INPUT DATA[/highlight]
A = Tom, Dick, Harry............
B = Maria, Lucie, Diana............
Constant 1 = Palm
Constant 2 = Beach
C = Mike, Ron, Carmen............
D = Mary, Cynthia, Alex...........
[highlight #CC0000]I am expecting a result as follows,[/highlight]
Row 1 = Tom.Maria.Palm.MikeMary.Beach
Row 2 = Dick.Lucie.Palm.RonCynthia.Beach
Row 3 = Harry.Diana.Palm.CarmenAlex.Beach
I know the regular concatenation query such as CONCAT(A,'.',B,'.',C). Since i have to insert some constant in between, i am getting confused. And also, there a COncatenation under a concatentaion.
Your help will be really appreciated. Thanks in advance.
Best!