Inserting a seperator in long numbers

From: Date: Wed, 08 Sep 2004 17:52:08 +0000
Subject: Inserting a seperator in long numbers
References: 1 2 3 4 5  Groups: php.db 
Request: Send a blank email to php-db+get-36113@lists.php.net to get a copy of this message
I have several tables with long numbers whose digits are always in some multiple of 8 eg 00000000 or 0000000000000000 etc...up to 160 digits long. The numbers all have a number of digits that is some multiple of 8. What I need to do is write an sql update query that will insert a - or some other seperator character every 8 digits in cases where the number of digits is higher than 8 i.e. 00000000-00000000, and so on for bigger numbers. What query would i use to do this?

« previous php.db (#36113) next »