I have a little problem that I haven’t been able to find a solution for yet.
Language: MySQL.
I have a table that contains the Names and Family names of 3 different people in one row, of course they’re in 6 columns
Example :
Name1 | Surname1 | Name2 | Surname2 | Name3 | Surname3 |
a | a | b | b | c | c |
d | d | e | e | f | f |
And so on…
Now I want these names in a select, to be shown as full names, for example :
Name1 | Name2 | Name3 |
a,a | b,b | c,c |
How can I achieve that? I’ve tried:
SELECT (name1, surname1) as name1, (name2, surname2) as name2, (name3, surname3) as name3 from Table;
And the same with + ' ' + instead of commas as well, and I’m not sure as to how I could solve my problem.
1 Answer