hello, i want update my row and concat my string but i have an error with this query
UPDATE FILE SET NOMFIC ='supp_'+D_NOMFIC WHERE IdFile = 2
hello, i want update my row and concat my string but i have an error with this query
UPDATE FILE SET NOMFIC ='supp_'+D_NOMFIC WHERE IdFile = 2
You can't concat with + in MySQL. Use CONCAT('supp_, D_NOMFIC)
, so it becomes UPDATE FILE SET NOMFIC = CONCAT('supp_, D_NOMFIC) WHERE IdFile = 2
For more info see: http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_concat
You can concat quoted strings like this: SELECT 'a' 'b' 'c' FROM someTable
though.
UPDATE FILE SET NOMFIC = CONCAT('supp_',NOMFIC) WHERE IdFile=2;
See the CONCAT()
function within the MySQL documentation here
CONCAT() basically takes as its parameters a list of strings to be concatenated together.