我需要更新mysql数据库中的一行,但我不想替换已经存储在其中的数据。示例:
select books from storedb where id='Rick';查询结果: Books = "example1“
但是我需要更新那一行,增加更多的书籍。
update storedb set books='example2' where id='Rick';但是它取代了当前的数据,所以我需要在不替换当前数据的情况下这样做。有人这样想:书本=‘例子1- example2";
发布于 2014-09-03 23:53:42
所以你需要一个字符串连接?试试这个:
update storedb set books=CONCAT(books,' -- ', 'example2') where id='Rick';https://stackoverflow.com/questions/25655300
复制相似问题