Afficher un message
Vieux 26/09/2007, 11h08   #1
mcl
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Regular Expression to Update a field

I am very new to MySQL and programming and I have some errors in a
field in my database

Field = 'Brian, Bill,Joe, Peter'

Some fields are missing the space after the 'comma'

I need to match on any 'comma + character'
but not 'comma + space'
and replace with 'comma + space + original character'

There can be more than one error in a field

so I guess I need something like

Update mytable set myfield = replace (mytable.myfield, some wonderful
regexp)

Any gratefully appreciated

Richard

  Réponse avec citation
 
Page generated in 0,05116 seconds with 9 queries