From c399c276051b62b3c19dd09d228eda0342a0e85f Mon Sep 17 00:00:00 2001 From: rokmcssu Date: Mon, 16 Jul 2007 05:01:00 +0000 Subject: [PATCH] =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=95=20=EB=B2=84?= =?UTF-8?q?=EA=B7=B8=20=EC=88=98=EC=A0=95:inst=5Fnum>groupby=5Fnum>orderby?= =?UTF-8?q?=5Fnum()=20=EB=8B=A8=EA=B3=84=EC=A0=81=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://xe-core.googlecode.com/svn/trunk@1942 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- classes/db/DBCubrid.class.php | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/classes/db/DBCubrid.class.php b/classes/db/DBCubrid.class.php index bd49de1da..7ae7da80c 100644 --- a/classes/db/DBCubrid.class.php +++ b/classes/db/DBCubrid.class.php @@ -575,14 +575,23 @@ if(count($output->groups)) $query .= sprintf(' group by %s', implode(',',$output->groups)); - if($output->order) { - foreach($output->order as $key => $val) { - $index_list[] = sprintf('%s %s', $val[0], $val[1]); - } - if(count($index_list)) $query .= ' order by '.implode(',',$index_list); + if ($output->order) { + foreach($output->order as $key => $val) { + $index_list[] = sprintf('%s %s', $val[0], $val[1]); + } + if(count($index_list)) $query .= ' order by '.implode(',',$index_list); + $query = sprintf('%s for orderby_num() between %d and %d', $query, $start_count, $list_count); + } + else { + if (count($output->groups)) + $query = sprintf('%s having groupby_num() between %d and %d', $query, $start_count, $list_count); + else { + if ($condition) + $query = sprintf('%s and inst_num() between %d and %d', $query, $start_count, $list_count); + else + $query = sprintf('%s where inst_num() between %d and %d', $query, $start_count, $list_count); + } } - - $query = sprintf('%s for orderby_num() between %d and %d', $query, $start_count, $list_count); $result = $this->_query($query); if($this->isError()) {