我要做的是创建一个连接 2 个表、人员和文档的视图。每个人会有很多文件,但我只想要那个人最近发布的文件。所以我想我加入了 2 个工作正常的表,然后我尝试从文档中订购发布日期以获得最新的,然后获得该行的顶部。对我来说这是有道理的,但我收到以下错误
that the SQL code is not complete
我的代码如下:
CREATE VIEW DisplayPersons
AS
SELECT
P.PERSON_ID AS "Person_ID",
P.SURNAME AS "Surname",
...
FROM PERSONS P
LEFT JOIN
DOCUMENTS D ON D.RECEIVED_BY = P.SURNAME||', '||P.INITIALS
ORDER BY D.ISSUED_DATE DESC
WHERE ROWNUM <= 1;