Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
MuthuMari MRank #5,738 · 288 reputationPosted Apr 5, 2012, 11:10 PM EDT
same table,
SELECT (FirstName + ' ' + LastName) "Employee First & Last Name" FROM Employees
ORDER BY FirstName ASC
SELECT (M.FirstnameName + ' ' + a.LastName) "First & Last Name" FROM firsttable m
INNER JOIN
secondtable a ON m.id = a.id
Pls refer this for more samples,
http://www.mysqltutorial.org/mysql-join-subqueries.aspx
Thanks.
brunda kRank #3,804 · 389 reputationPosted Apr 6, 2012, 2:35 AM EDT
SenthilkumarRank #387 · 6.5K reputationPosted Apr 6, 2012, 10:47 PM EDT
You can use the query or function to join the two names in the same table or multiple table.
SELECT EmployeeID, FirstName+' '+LastName AS [Employee Name] FROM Employees
SELECT EmployeeID, FirstName+SPACE(2)+LastName AS [Employee Name] FROM Employees
Here SPACE function is used to give the space between the string. It accepts the integer value to give the space.
If your question is related to join the two names which is in the different table then yes!
SELECT E.EmployeeID, E.FirstName+' '+EA.LastName AS [Full Name] FROM Employees E INNER JOIN EmployeeAdditional EA
ON EA.EmployeeID = E.EmployeeID
Here i have two tables. The first name is in the one table and last name in another table. Here i have used the inner join to combine two columns names.