ERROR 1176 (42000): Key 'XXX' doesn't exist in table 'XXX'报错处理

MySQL5.7对sql语句强制使用索引查询时报错如下:

ERROR 1176 (42000): Key 'XXX' doesn't exist in table 'XXX'报错处理

解决:这里的id字段是表的主键,查看别人的经验贴得知是语法错误,参考链接https://*.com/questions/19205004/key-emp-no-doesnt-exist-in-table-employees ,当强制索引是主键时sql语句应这样写

mysql> SELECT COUNT(UA.id) AS tp_count FROM  ck_user_audit UA RIGHT JOIN ck_user AS U force index(PRIMARY) ON U.id = UA.uid LIMIT 1;

 

上一篇:tensorflow训练模型遇到的问题The name 'DecodeJpeg/contents:0' refers to a Tensor which does not exis


下一篇:npm和yarn镜像源更新