7 messages in com.mysql.lists.win32Re: Adding a space in CONCAT
FromSent OnAttachments
Greg Quinn17 Apr 2004 12:39 
Charles Mabbott17 Apr 2004 12:42 
Dr. Virginia R. Hetrick17 Apr 2004 14:25 
Graeme St.Clair18 Apr 2004 11:51 
Graeme St.Clair18 Apr 2004 12:07 
rob spijkerman18 Apr 2004 13:51 
East Bay Technologies18 Apr 2004 15:17 
Subject:Re: Adding a space in CONCAT
From:rob spijkerman (rob.@alliedtelesyn.co.nz)
Date:04/18/2004 01:51:38 PM
List:com.mysql.lists.win32

If you are looking for a space then use CONCAT_WS.

like this: select CONCAT_WS(' ',fisrtsname,lastname) as name

That will put a space between the two variables.

Cheers..

Rob

------------------------------------------------------------------------------------------------------------------------ Rob Spijkerman 27 Nazareth Avenue Senior Intranet Developer PO Box 8011 Allied Telesyn Research Christchurch Phone +64 3 339 3000 New Zealand DDI +64 3 339 9682 Email: rob.@alliedtelesyn.co.nz Fax +64 3 339 3001 web: http://www.alliedtelesyn.co.nz/

------------------------------------------------------------------------------------------------------------------------

"Graeme St.Clair" <grae@charter.net> 19/04/2004 7:07:42

a.m. >>> Brain lock. Please ignore my last post - like the little lad in the AFLAC ad (apols to non-USA readers), I was not "paying attention".

But are you by any chance getting error 1269 or 1270? If so, you probably need to cast the string ' ' to some other character set e.g. select concat(FileName, _utf8 ' ', FileSize) from blah where blah;

Rgds, G.

----- Original Message ----- From: Greg Quinn To: win@lists.mysql.com Sent: Saturday, April 17, 2004 3:39 PM Subject: Adding a space in CONCAT

I am trying to add a space between two values in my CONCAT statement but nothing works...

I have tried

Select CONCAT(FileName, ' ', FileSize)

and

Select CONCAT(FileName, Char(32), FileSize)

But neither puts a space in between...

how do I do this?

Thanks Greg

------------------------------------------------------------------------------

-- MySQL Windows Mailing List For list archives: http://lists.mysql.com/win32 To unsubscribe: http://lists.mysql.com/win32?unsub=grae@charter.net