连接 table 时出现单力索引抛出错误
Single force index throwing error on joined table
我正在尝试使用左联接桥接两个 table 并强制索引一个仅存在于已联接的 table 上的索引,但出现以下错误:
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 'FORCE INDEX (l.sfdcId) WHERE l.sfdcId = '003A000001eR0HsIAK'
ORDER BY a.activity' at line 3
这是查询的输出 运行(如果我删除 FORCE INDEX 则工作正常):
SELECT a.activityDate,a.primaryAttributeValue,a.attributeDescription,l.firstName,l.lastName,l.title,l.email
FROM activities AS a LEFT JOIN
leads AS l
ON a.leadId = l.leadId FORCE INDEX (l.sfdcId)
WHERE l.sfdcId = '003A000001eR0HsIAK'
ORDER BY a.activityDate DESC
知道为什么会失败吗?
FORCE INDEX
在 table 定义之后:
SELECT a.activityDate,a.primaryAttributeValue,a.attributeDescription,
l.firstName,l.lastName,l.title,l .email
FROM activities a LEFT JOIN
leads l FORCE INDEX (sfdcId)
ON a.leadId = l.leadId
WHERE l.sfdcId = '003A000001eR0HsIAK'
ORDER BY a.activityDate DESC ;
我正在尝试使用左联接桥接两个 table 并强制索引一个仅存在于已联接的 table 上的索引,但出现以下错误:
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 'FORCE INDEX (l.sfdcId) WHERE l.sfdcId = '003A000001eR0HsIAK' ORDER BY a.activity' at line 3
这是查询的输出 运行(如果我删除 FORCE INDEX 则工作正常):
SELECT a.activityDate,a.primaryAttributeValue,a.attributeDescription,l.firstName,l.lastName,l.title,l.email
FROM activities AS a LEFT JOIN
leads AS l
ON a.leadId = l.leadId FORCE INDEX (l.sfdcId)
WHERE l.sfdcId = '003A000001eR0HsIAK'
ORDER BY a.activityDate DESC
知道为什么会失败吗?
FORCE INDEX
在 table 定义之后:
SELECT a.activityDate,a.primaryAttributeValue,a.attributeDescription,
l.firstName,l.lastName,l.title,l .email
FROM activities a LEFT JOIN
leads l FORCE INDEX (sfdcId)
ON a.leadId = l.leadId
WHERE l.sfdcId = '003A000001eR0HsIAK'
ORDER BY a.activityDate DESC ;