如何在Mysql中执行以下的语句,
update cale set hvmic=hvi.hvmic
from hvi
where cale.bbarcode=hvi.clot and cale.bbarcode like '%Aod394%'
执行时报如下错
Error Code : 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from hvi
where cale.bbarcode=hvi.clot and cale.bbarcode like '%Aod394%' ' at line 2
(0 ms taken)
请大家帮忙,谢谢
update cale set hvmic=hvi.hvmic
from hvi
where cale.bbarcode=hvi.clot and cale.bbarcode like '%Aod394%'
执行时报如下错
Error Code : 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from hvi
where cale.bbarcode=hvi.clot and cale.bbarcode like '%Aod394%' ' at line 2
(0 ms taken)
请大家帮忙,谢谢
解决方案 »
- MySQL连接密码的问题
- 紧急!!!请教高手解决问题
- 急!!! mysql导入sql文件问题
- 关于mysql得数据备份
- AUTO_INCREMENT 会不会超过最大值啊?
- 如何用MySQl存储图片?
- 请大家发表意见!
- 我的LINUX在装MYSQL时.gz格式的!在MAKE时,提示找不到linux/autoconf.h文件,无法编译昨办?
- mysql中一个字段是用auto_increment的id,加入一些记录后删掉,(如id=10,11,12),删掉后再插入为什么id从13开始?有什么办法解决?我用phpadmin
- mysql组合索引like的问题
- PHPMYADMIN备份数据,恢复时出错
- sql运行速度问题
select hvmic from hvi
where cale.bbarcode=hvi.clot and cale.bbarcode like '%Aod394%' limit 1
)
发现Mysql这一点,不知对不对,
更新时,如两表数据相同,会不更新。
只有不同时才会更新。这点与Sql2000不同
如果更新的前后的数据是一样的,则 mysql_affected_rows() 返回 0;如
update tb set x='aa' where x='aa';虽然库中存在 x='aa' 的记录,但 MySQL 不必对数据进行更改,所以 mysql_affected_rows() 返回 0.