1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-12 09:34:10 +02:00

Pagination support in Oracle (bug #3306828)

This commit is contained in:
Jakub Vrana
2011-05-24 15:20:13 +02:00
parent baf21724cf
commit 6a491373c2
3 changed files with 9 additions and 1 deletions

View File

@@ -153,7 +153,10 @@ if (isset($_GET["oracle"])) {
}
function limit($query, $where, $limit, $offset = 0, $separator = " ") {
return " $query$where" . (isset($limit) ? ($where ? " AND" : $separator . "WHERE") . ($offset ? " rownum > $offset AND" : "") . " rownum <= " . ($limit + $offset) : "");
return ($offset ? " * FROM (SELECT t.*, rownum AS rnum FROM (SELECT $query$where) t WHERE rownum <= " . ($limit + $offset) . ") WHERE rnum > $offset"
: (isset($limit) ? " * FROM (SELECT $query$where) WHERE rownum <= " . ($limit + $offset)
: " $query$where"
));
}
function limit1($query, $where) {