原先在mysql数据库的表里没有设置主键,然后在Navicat窗口里修改数据,把这个amount值改为0,无法成功。有警示信息:
其实Navicat是执行了这条语句:
UPDATE `test22`.`zhishu_dongcai_tmp` SET `amount` = 0 WHERE `ts_code` = '399106' AND `trade_date` = Cast('2021-11-23' AS Binary(10)) AND `open` = 2522.23 AND `close` = 2520.37 AND `high` = 2528.79 AND `low` = 2515.33 AND `vol` = 480712000 AND `amount` = 720402993152 AND `zhenfu` = 0.53 AND `pct_chg` =-0.21 AND `change` = -5.21 AND `huanshou` = 2.05 LIMIT 1
这个代码没有成功执行,自己去把它输到命令行执行也一样。
现在问题是表没有设置主键,如果现在不想设置主键,还想修改数据怎么办呢,应急一下,把上面那条语句后面一堆的AND去掉就好了,只执行这