Darkmatter5 Posted June 16, 2009 Share Posted June 16, 2009 If I have a table that has Firstname and Lastname as fields in each record, how can I build a query that returns an alias named "Name" using "Firstname Lastname"? Quote Link to comment Share on other sites More sharing options...
kickstart Posted June 16, 2009 Share Posted June 16, 2009 Hi SELECT CONCAT(Firstname," ",Lastname) AS Name FROM someTable All the best Keith Quote Link to comment Share on other sites More sharing options...
fenway Posted June 18, 2009 Share Posted June 18, 2009 I prefer CONCAT_WS( '', Firstname, Lastname) -- makes it easier to add more columns. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.