On Fri, 15 Oct 2004, David Hummel wrote:

> On Thu, Oct 14, 2004 at 09:54:19PM -0700, Dylan Beaudette wrote:
> >
> > after searching about on google, and the MySQL manual ... i can't seem to find
> > an equivilent function in MySQL to Oracle's TRANSLATE() function...
>
> You could use a nested REPLACE:
>
>  Oracle: TRANSLATE('string','str','123') -> '123ing'
>
>  MySQL:  REPLACE(REPLACE(REPLACE('string','s','1'),'t','2'),'r','3') -> '123ing'

That doesn't look like the same thing.  For example, consider:

Oracle: TRANSLATE('string','str','rst') -> 'rsting'
MySQL: REPLACE(REPLACE(REPLACE('string','s','r'),'t','s'),'r','t')->'tsting'

Not that I got any better solution. =P

-Mark

-- 
Mark K. Kim
AIM: markus kimius
Homepage: http://www.cbreak.org/
Xanga: http://www.xanga.com/vindaci
Friendster: http://www.friendster.com/user.php?uid=13046
PGP key fingerprint: 7324 BACA 53AD E504 A76E  5167 6822 94F0 F298 5DCE
PGP key available on the homepage
_______________________________________________
vox-tech mailing list
[EMAIL PROTECTED]
http://lists.lugod.org/mailman/listinfo/vox-tech

Reply via email to