1

mysql 5.5 でこれを行うにはどうすればよいですか? concatを考えていましたが、もっと簡単なものがあると思います。

id  content
1
2

update posts set content='here is content ' + this.id

となることによって:

id content 
1  here is content 1
2  here is content 2

どうも

4

2 に答える 2

1

これはあなたが必要とすることをします:

update posts
    set content=CONCAT('here is content ', CAST(id as CHARACTER))

これは、SQLFiddle のテストへのリンクです。

于 2012-04-19T00:52:12.553 に答える
0

私は推測する:

update comment set comment=concat('here is a comment: ', id,' these are other things');
于 2012-04-19T00:51:24.553 に答える