[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Changing data
Hi,
> how would I change in all rows data that is;
> 0000000000
It goes something like this:
> to 000-000-0000
update my_table
set my_field = concat(left(my_field, 3), '-', mid(my_field,4,3), '-', right(my_field,4));
> or (000) 000-0000
update my_table
set my_field = concat('(', left(my_field, 3), ') ', mid(my_field,4,3), '-', right(my_field,4));
Regards,
Sasa
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <mysql-thread92891@xxxxxxxxxxxxxxx>
To unsubscribe, e-mail <mysql-unsubscribe-treed=ultraviolet.org@xxxxxxxxxxxxxxx>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
This mailing list archive is a service of Copilot Consulting.