i have problem query this:
$ssqlaux = $this->select()->setintegritycheck(false) ->from(array("a_aux" => $this->_name), "id_a", $this->_schema) ->join(array("b_aux"=> "b"), "a_aux.id_a = b_aux.id_b", array(), $this->_schema) ->join(array("c_aux"=> "c"), "a_aux.id_inscrito = c_aux.id_c", array(), $this->_schema) ->where("b_aux.id_b = ?", $this->idb) ; $ssql = $this->select()->setintegritycheck(false) ->from(array("a" => $this->_name), "a.id_a, a.campo_a", $this->_schema) ->joinleft(array("b" => "b"), "a.id_a = b.id_b", "b.campo_b", $this->_schema) ->joinleft(array("c" => "c"), "b.id_b = c.id_c", "c.campo", $this->_schema) ->where("c.campo_c = ?", "string") ->where("a.id_a in (?)", new zend_db_expr($ssqlaux)) ->order("c.campo_c") ;
and return data, asterisk added before name of table, in case, in 1 of left joins, table b (left join schema.*b on a.id_a = b.id_b) following example
select a.id_a, a.campo_a b.campo_b, c.campo_c schema.a left join schema.*b on a.id_a = b.id_b left join schema.c c on a.id_a = c.id_c (c.campo_c = 'string') , (a.id_a in ( select a_aux.id_a schema.a a_aux inner join schema.b b_aux on a_aux.id_a = b_aux.id_b inner join schema.c c_aux on a_aux.id_a = c_aux.id_c (a_aux.id_segundo_id = 5321))) order c.campo asc )
these examples of problem i'm having, if error in logic or syntax error in typing. real problem asterisk added zend before table name in join.
if has understood problem , have solution can share of great help.
i'm using zend 1
thank's!
i had same problem , solved it. on oracle database , table names , columns names must in capital. try b_aux instead of b_aux if you're on oracle db too.
Comments
Post a Comment