Click here to Skip to main content
14,641,793 members
Rate this:
Please Sign up or sign in to vote.
See more:
Is there a way to return two columns as one in mysql.

Something in the lines of...
Table Movie.
Id
Title
TitleSub

select id, title+titlesub as combinedName from table



result
ID.....combinedName
1......Bob+Marley
2......Star Wars + Thumb Wars
3......Underworld + Vacation
4....
Posted

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

Yes. You can concatenate column values in SQL.

SELECT 
  Id, (TITLE + TITLESUB) AS CombinedName
FROM 
  Movie

You can read about the same here.[^]
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100