novicecoder.com

August 20, 2006

Find and replace in SQL tables

Pretty obvious, but I had to look it up so I figured I should save it here. Say I misspelled “people” as “peeple” and I wanted to fix them all in my database. Just do:

UPDATE table SET field=REPLACE(field, ‘peeple‘, ‘people‘ );
Filed under: Site Info — Kevin @ 6:17 am

Home
© 2006 NoviceCoder | All rights reserved.