开发者

copy one field from table to another field in the same table

I used this query to copy one full column from the same table:

UPDATE 'content_type_chapter' 
   SET 'field_chapternumbersort2_value' = 'field_chapternumbersort_value'

But I have received this error.

You have an e开发者_StackOverflow社区rror in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''content_type_chapter' SET 'field_chapternumbersort2_value'='field_chapternumber' at line 1

What could be wrong, I'm unable to get it right.


Single-quotes are for strings.

Try backticks instead, e.g.:

UPDATE 
    `content_type_chapter` 
SET 
    `field_chapternumbersort2_value` = `field_chapternumbersort_value`

The backticks aren't strictly necessary, though.


Just leave the quotes off your field names, otherwise it thinks you are giving it strings

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜