以下查询在 MySQL 中运行良好:
SELECT
total,
status.nome
FROM status
INNER JOIN (SELECT count(*) AS total,
status_id
FROM [log]
WHERE evento_id = '21'
AND data BETWEEN '02/09/2013 00:00:00' AND '02/09/2013 23:59:59'
GROUP BY status_id) AS groupedTable
ON groupedTable.status_id = status.id;
但是当我尝试在 Oracle 中运行它时,我收到以下错误消息:
ORA-00903: 无效的表名
如果我将查询更改为:
SELECT
total, status.nome
FROM
status
INNER JOIN (
SELECT count(*) as total, status_id
FROM log
WHERE evento_id = '21'
AND data BETWEEN '02/09/2013 00:00:00' AND '02/09/2013 23:59:59'
GROUP BY status_id) AS groupedTable
ON groupedTable.status_id = status.id;
我收到此错误消息:
ORA-00905: keyword not found
我认为问题出在log
表中,但我无法将其转换并使其在 Oracle 中工作。有人可以帮我吗?