Unix Technical Forum

Re: Replace, Substitute, Delete

This is a discussion on Re: Replace, Substitute, Delete within the MySQL General forum forums, part of the MySQL category; --> Instead of individual replacements, as in ... SELECT REPLACE('De Long', ' ', ''); would this global approach work? SELECT ...


Go Back   Unix Technical Forum > Database Server Software > MySQL > MySQL General forum

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 06:22 AM
John Kebbel
 
Posts: n/a
Default Re: Replace, Substitute, Delete

Instead of individual replacements, as in ...

SELECT REPLACE('De Long', ' ', '');

would this global approach work?

SELECT REPLACE(imgName,' ','') FROM staff WHERE imgName REGEXP ' ';

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 06:22 AM
Scott Haneda
 
Posts: n/a
Default Re: Replace, Substitute, Delete

> Instead of individual replacements, as in ...
>
> SELECT REPLACE('De Long', ' ', '');
>
> would this global approach work?
>
> SELECT REPLACE(imgName,' ','') FROM staff WHERE imgName REGEXP ' ';


I just used that as an example. What you are doing is fine, you put the
field name in the first argument of the REPLACE() function. You no not need
to add the where imgname REGEXP part at all.

SELECT REPLACE(imgName,' ','') FROM staff
That should suffice, unless you have some other limiting factor you want to
toss in like :

SELECT REPLACE(imgName,' ','') FROM staff WHERE imgName LIKE '%d'
You get the idea, that would select all image names that end in 'd'
--
-------------------------------------------------------------
Scott Haneda Tel: 415.898.2602
<http://www.newgeo.com> Novato, CA U.S.A.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:28 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com