【发布时间】:2017-09-14 03:41:09
【问题描述】:
我在我的 DataGrip 上写了一个 MySQL 更新 SQL 来更新错误的数据:
update common_express_track set step = 135 where express_id in (33, 235, 237) and business_source = 0 and step = 0 and content = 'Out For Delivery' order by content;
我执行了它,控制台显示“61 行在 7s 530ms 内受到影响”,然后我执行了另一个查询语句以确保数据已被修改。
select * from common_express_track where express_id in (33, 235, 237) and business_source = 0 and step = 0 and content = 'Out For Delivery' order by content;
然后控制台显示“0 rows retrieved in 3s 751ms”。
但是当我重启DataGrip并再次执行查询语句时,我得到了61行,这意味着更新语句不起作用,我不知道为什么,是因为缓存还是什么?
如何解决这个问题?
【问题讨论】:
-
使用 mysql 控制台并在那里检查
-
您的
SELECT的WHERE包含step=0,而UPDATE将其设置为135.... -
@Usagi Miyamoto - 是的,但剩下的问题解释了原因,没关系
-
在句子中`但是当我重新启动datagrip并再次执行查询语句时,` - 你的意思是第二个查询吗?
-
顺便说一句,“重新启动 datagrip”是什么意思?
标签: mysql jetbrains-ide datagrip