|
Posted by plato on 12/08/05 12:29
"Steve" <googlespam@nastysoft.com> wrote in message
news:1133955388.084012.84570@g47g2000cwa.googlegroups.com...
>
> > 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
I worked out I got the codename and number mixed but even this
SELECT *
FROM `photos`
UPDATE 'photos' SET codenumber = CONCAT( LEFT( codenumber, LENGTH(
codenumber ) -2 ) , CONCAT( '/', RIGHT( codenumber, 2 ) ) ) LIMIT 0 ,
30
gave me the same reply?
Navigation:
[Reply to this message]
|