Alice
Alice

Reputation: 1

What is the proper SQL syntax for TOP WITH TIES in Oracle DB?

Oracle does not allow TOP WITH TIES so I was wondering how can I write this not using TOP WITH TIES to comply with Oracle DB standards? Thank you.

enter image description here

Upvotes: 0

Views: 2263

Answers (1)

Tom H
Tom H

Reputation: 47392

Oracle v12.1+ has its own row limiting function:

SELECT
    S.EmpID,
    S.Ename,
    ...
FROM
    SalesPersons S
LEFT JOIN ...
GROUP BY ...
ORDER BY ...
FETCH FIRST 1 ROW WITH TIES

Upvotes: 3

Related Questions