I've looked at translation rules for SQL Server's
SELECT TOP n, but Postgres uses
LIMIT n, whereas Oracle uses
WHERE ROWNUM <= n. Especially the last one, where you may have to add an expression to an existing where clause, seems a bit tricky.
One workable solution for now is to wrap your query like this:
SELECT ROW_NUMBER() OVER (ORDER BY [some variable]) AS rn, *
FROM ( [your query] ) tmp
WHERE rn <= 100;
@Juan_Banda: Could you give a bit of context about why you need to select the top n?