好的,所以我需要计算“resource_ID”在我的表中出现少于 3 次的次数,然后从另一个表链接资源描述。
到目前为止我有
Select Resource_hire.Resource_ID, count(resource_ID) as Times_Used
from RESOURCE_HIRE
Group by resource_ID
HAVING COUNT(*)< 3;
但是当我添加
SELECT RESOURCE_INVENTORY.DESCRIPTION, RESOURCE_HIRE.RESOURCE_ID
FROM RESOURCE_HIRE, RESOURCE_INVENTORY
WHERE (RESOURCE_HIRE.RESOURCE_ID = RESOURCE_INVENTORY.R_ID)
INNER JOIN (Select Resource_hire.Resource_ID, count(resource_ID)
from RESOURCE_HIRE
Group by resource_ID
HAVING COUNT(*)< 3;)
i Get SQL 命令未正确结束
谢谢