trying to write a sql which will keep first N number of rows of a table and delete the rest. I'm have comeup with this sql but the its saying I can't use the count here. Please help me to re write the sql.
DELETE
FROM ZZ_TEST_FINTABLE
WHERE PROCESS_INSTANCE = (
SELECT MIN(B.PROCESS_INSTANCE)
FROM ZZ_TEST_FINTABLE B)
AND COUNT(PROCESS_INTANCE) > 9