Reputation: 3
I need a query that will select 2 columns in the same table and then display those to columns as 1 column.
I have this table..
fname | lname
john | doe
jane | doe
I want to display it like this..
name |
john doe |
jane doe |
Upvotes: 0
Views: 96
Reputation: 17161
SQL Server 2008 or earlier:
SELECT fname + ' ' + lname As name
FROM users
SQL Server 2012 onwards and MySQL
SELECT Concat(fname, ' ', lname) As name
FROM users
Upvotes: 0
Reputation: 129792
Assuming SQL Server:
SELECT fname + ' ' + lname FROM users
In MySQL Server:
SELECT concat(fname, " ", lname) FROM users
Upvotes: 5