we can use inner join in asp.net .... if we join two names like Firstname and lastname as a single name
we can use inner join in asp.net .... if we join two names like Firstname and lastname as a single name
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
SenthilkumarPosted Apr 7, 2012, 2:47 AM
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.
brunda kPosted Apr 6, 2012, 6:35 AM
MuthuMari MPosted Apr 6, 2012, 3:10 AM
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.