add batch remove batch split batch comment selection show hidden batches hide batch highlight batch
db<>fiddle
donate feedback about
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
10 rows affected
VAL
10
9
8
7
6
VAL
10
9
8
7
6
1 rows affected

dbms_output:
SELECT "A1"."VAL" "VAL" FROM  (SELECT "A2"."VAL" "VAL","A2"."VAL" "rowlimit_$_0",ROW_NUMBER() OVER ( ORDER BY "A2"."VAL" DESC ) "rowlimit_$$_rownumber" FROM "FIDDLE_HCDUBQSBAUCTAXJXFTYS"."ROWNUM_ORDER_TEST" "A2") "A1" WHERE "A1"."rowlimit_$$_rownumber"<=5 ORDER BY "A1"."rowlimit_$_0" DESC
1 rows affected

dbms_output:
SELECT "A1"."VAL" "VAL" FROM  (SELECT "A2"."VAL" "VAL","A2"."VAL" "rowlimit_$_0",RANK() OVER ( ORDER BY "A2"."VAL" DESC ) "rowlimit_$$_rank" FROM "FIDDLE_HCDUBQSBAUCTAXJXFTYS"."ROWNUM_ORDER_TEST" "A2") "A1" WHERE "A1"."rowlimit_$$_rank"<=5 ORDER BY "A1"."rowlimit_$_0" DESC
1 rows affected

dbms_output:
SELECT "A1"."VAL" "VAL" FROM  (SELECT "A2"."VAL" "VAL","A2"."VAL" "rowlimit_$_0",ROW_NUMBER() OVER ( ORDER BY "A2"."VAL") "rowlimit_$$_rownumber" FROM "FIDDLE_HCDUBQSBAUCTAXJXFTYS"."ROWNUM_ORDER_TEST" "A2") "A1" WHERE "A1"."rowlimit_$$_rownumber"<=CASE  WHEN (4>=0) THEN FLOOR(TO_NUMBER(4)) ELSE 0 END +4 AND "A1"."rowlimit_$$_rownumber">4 ORDER BY "A1"."rowlimit_$_0"