Posted by Steve on 12/07/05 13:36
> My database has a variable $codename and the fields are populated with G115
> up to say G1515.... the first 2 or 3 (in the case of a string of 4)digits
> represent a Gallery and the last 2 digits represent the painting number. I
> want to add a / between the gallery and painting number so for example G215
> will become G2/15 and G1316 will become G13/16.
UPDATE mytable
SET codename =
CONCAT(
LEFT( codename, LENGTH( codename ) - 2 ),
CONCAT( '/', RIGHT( codename, 2 ) )
)
---
Steve
[Back to original message]
|