MySQL joined select

Ken Ray kray at sonsothunder.com
Mon Mar 19 13:29:06 EDT 2012


On Mar 19, 2012, at 3:44 AM, Marek Reichenbach wrote:
> when i get for example: 1234567 -> i should get result +++++++, 123-56-  I
> would get +++-++- .

The only way I know is kind of ugly, requiring seven nested REPLACE statements:

SELECT REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE("123-56-","1","+"),"2","+"),"3","+"),"4","+"),"5","+"),"6","+"),"7","+")

This would return:

+++-++-


Ken Ray
Sons of Thunder Software, Inc.
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/	




More information about the use-livecode mailing list