我似乎无法弄清楚为什么会发生此错误。
这是我的代码:
SELECT DISTINCT c.cid
FROM customers c
WHERE EXISTS ( SELECT DISTINCT t.aid
FROM transactions t
WHERE EXISTS ( SELECT a.balance
FROM accounts a
WHERE t.cid = c.cid
AND a.aid = t.aid
AND ((sysdate - a.date_opened) > 365)
ORDER BY a.balance DESC
)
);
错误在最后一行。