combining fields in select
I am trying to select the firstname and surname fields from a table. select firstname + surname fullname from people; This does work in other databases but does not seem to work here. Am I doing something wrong or is there a different way to achieve this with mysql? Michael
Re: combining fields in select
I am trying to select the firstname and surname fields from a table. select firstname + surname fullname from people; This does work in other databases but does not seem to work here. Am I doing something wrong or is there a different way to achieve this with mysql? Michael -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: combining fields in select
On 18 September, 2003 11:56, Michael Piko [SMTP:[EMAIL PROTECTED] wrote: I am trying to select the firstname and surname fields from a table. select firstname + surname fullname from people; try: select concat(firstname,surname) as fullname from people; HTH, Mark --- Windows, Linux and Internet Development Consultant Email: [EMAIL PROTECTED] Web: http://www.scriptsmiths.co.za --- This does work in other databases but does not seem to work here. Am I doing something wrong or is there a different way to achieve this with mysql? Michael DISCLAIMER: This e-mail and its attachments may contain information that is confidential and that may be subject to legal privilege and copyright. If you are not the intended recipient you may not peruse, use, disclose, distribute, copy or retain this message. If you have received this message in error, please notify the sender immediately by e-mail, facsimile or telephone and return and thereafter destroy the original message.Please note that e-mails are subject to viruses, data corruption, delay, interception and unauthorised amendment, and that the sender does not accept liability for any damages that may be incurred as a result of communication by e-mail. No employee or intermediary is authorised to conclude a binding agreement on behalf of the sender by e-mail without express written confirmation by a duly authorised representative of the sender. By transmitting this e-mail message over the Internet the sender does not intend to allow the contents hereof to become part of the public domain, and the confidential nature of the contents shall not be altered or diminished from by such transmission. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: combining fields in select
Michael --Original Message- I am trying to select the firstname and surname fields from a table. select firstname + surname fullname from people; This does work in other databases but does not seem to work here. Am I doing something wrong or is there a different way to achieve this with mysql? select CONCAT(TRIM(firstname),' ',surname) AS fullname from people should work Terry -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: combining fields in select
Piko, Please see http://www.mysql.com/doc/en/String_functions.html for more information about String functions in the SELECT. The function you're looking for is CONCAT or CONCAT_WS. Harald - Original Message - From: Michael Piko [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 18, 2003 11:55 AM Subject: combining fields in select I am trying to select the firstname and surname fields from a table. select firstname + surname fullname from people; This does work in other databases but does not seem to work here. Am I doing something wrong or is there a different way to achieve this with mysql? Michael -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]