|
Posted by plato on 12/08/05 12:26
"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
What am I doing wrong here:
SELECT *
FROM `photos`
UPDATE photos SET codenumber = CONCAT( LEFT( codename, LENGTH(
codename ) -2 ) , CONCAT( '/', RIGHT( codename, 2 ) ) ) LIMIT 0 ,
30
and I get:
#1064 - You have an error in your SQL syntax. Check the manual that
corresponds to your MySQL server version for the right syntax to use near
'UPDATE photos SET codenumber = CONCAT( LEFT( codename , LENG
thanks
Navigation:
[Reply to this message]
|