数据库 `bbs` 是当前正在用的数据库,一周前转移服务器导入的时候有些文字乱码,但因为有很多新数据,不能恢复到1周前.数据库 `bbs2` 是1周前的数据库.现在想把 bbs 中的表 cdb_posts 以前的数据更新至旧版(主键为 pid),应该怎么写?update `bbs`.cdb_posts as x, `bbs2`.cdb_posts as y
set x.subject=y.subject, x.message=y.message
where x.pid=y.pid and y.pid>0; 这样写有问题吗?
set x.subject=y.subject, x.message=y.message
where x.pid=y.pid and y.pid>0; 这样写有问题吗?
解决方案 »
- 做MYSQL同步时,从服务器无法连接主服务器,错误代码:2003
- 紧急求助 MYSQL 修改密码后登陆不上去!
- SQL 报错 Every derived table must have its own alias
- 请教在bin下执行./mysqldump -u someone -p db < db.sql和./mysql -u someone -p db < db.sql的区别
- 基本的myslq数据类型都有哪些?
- 请教各位!! 建立odbc的数据源不能连接mysql数据库
- 新手的mysql的系统时间插入问题
- 如何防止多用户同时注册,以及多用户同时注册同一个用户名?
- MySQL创建为什么错误
- 求帮忙,关于查询每天出现的SQL
- 求助 在NIST上怎么下载光谱数据库数据(ASD)
- 求教:每个分类各取10条数据,相同时间上的数据显示在一条记录上,这样的SELECT语句怎么写?
update `bbs`.cdb_posts as x, `bbs2`.cdb_posts as y
set x.subject=y.subject, x.message=y.message
where x.pid=y.pid and y.pid>0 and x.id between 1 and 1000;