Possible Duplicate:
How can I use mySQL replace() to replace strings in multiple records?
MySQL search to ignore hyphens
What is the best way to remove hyphens from a field using mysql UPDATE without php?
field: 211-555-1212 > 2115551212
You can use the REPLACE()
function, for UPDATE
UPDATE yourtable
SET field = replace(field, '-', '')
See SQL Fiddle With Demo
For SELECT
:
SELECT replace(field, '-', '') field
FROM yourtable
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With