mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 18:51:41 +09:00
First version of uncorellated select subquery.
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0-DB@8539 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
af9ced8c5c
commit
0a53ac3e9d
5 changed files with 315 additions and 18 deletions
|
|
@ -12,7 +12,30 @@
|
|||
var $limit;
|
||||
|
||||
var $arguments = null;
|
||||
|
||||
function Query($queryID = null
|
||||
, $action = null
|
||||
, $columns = null
|
||||
, $tables = null
|
||||
, $conditions = null
|
||||
, $groups = null
|
||||
, $orderby = null
|
||||
, $limit = null){
|
||||
$this->queryID = $queryID;
|
||||
$this->action = $action;
|
||||
|
||||
$this->columns = $columns;
|
||||
$this->tables = $tables;
|
||||
$this->conditions = $conditions;
|
||||
$this->groups = $groups;
|
||||
$this->orderby = $orderby;
|
||||
$this->limit = $limit;
|
||||
}
|
||||
|
||||
function show(){
|
||||
return true;
|
||||
}
|
||||
|
||||
function setQueryId($queryID){
|
||||
$this->queryID = $queryID;
|
||||
}
|
||||
|
|
@ -110,8 +133,14 @@
|
|||
function getSelectString($with_values = true){
|
||||
$select = '';
|
||||
foreach($this->columns as $column){
|
||||
var_dump($column);
|
||||
if($column->show())
|
||||
$select .= $column->getExpression($with_values) . ', ';
|
||||
if(is_a($column, 'Subquery')){
|
||||
$oDB = &DB::getInstance();
|
||||
$select .= '(' .$oDB->getSelectSql($column, $with_values) . ') as \''. $column->getAlias().'\', ';
|
||||
}
|
||||
else
|
||||
$select .= $column->getExpression($with_values) . ', ';
|
||||
}
|
||||
if(trim($select) == '') return '';
|
||||
$select = substr($select, 0, -2);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue