1
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行目。

なぜこのエラーが発生するのですか?

4

1 に答える 1

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;
于 2012-11-19T11:39:49.063 に答える