MySQL5.7对sql语句强制使用索引查询时报错如下:
解决:这里的id字段是表的主键,查看别人的经验贴得知是语法错误,参考链接https://stackoverflow.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;
ERROR 1176 (42000): Key 'XXX' doesn't exist in table 'XXX'报错处理
原文地址:https://www.cnblogs.com/godfather007/p/10444049.html
时间: 2024-08-29 07:52:36