ORA-00907:缺少右括号

时间:2012-11-19 11:36:40

标签: oracle select join

SELECT * FROM (
SELECT SUM(A.Precio)AS "Total gastado", B.email FROM ARTICULO_EVENTO A
    JOIN (C.email FROM PEDIDO_ARTICULO_EVENTO C)B
    ON(B.email=A.email)
WHERE B.FechaHora > TO_DATE('20-08-2012', 'MM-DD-YYYY')
GROUP BY (B.email)
ORDER BY SUM(A.Precio) DESC
)
WHERE ROWNUM <=5;

ORA-00907:缺少右括号。在第3行。

¿为什么我会收到此错误?

1 个答案:

答案 0 :(得分:2)

尝试这个,你忘记了子查询中的select关键字并留下了“;”:

SELECT * FROM (
SELECT SUM(A.Precio)AS "Total gastado", B.email FROM ARTICULO_EVENTO A
    JOIN (select C.email FROM PEDIDO_ARTICULO_EVENTO C)B
    ON(B.email=A.email)
WHERE B.FechaHora > TO_DATE('20-08-2012', 'MM-DD-YYYY')
GROUP BY (B.email)
ORDER BY SUM(A.Precio) DESC
)
WHERE ROWNUM <=5;