Ver Mensaje Individual
  #2 (permalink)  
Antiguo 27/01/2010, 09:34
Avatar de GatorV
GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 17 años, 11 meses
Puntos: 2135
Respuesta: Consultas con Zend_Db

No es 100% necesario que lo hagas con un Zend_Db_Select, si tu query es tan compleja la puedes dejar así y solamente hacer:
Código PHP:
Ver original
  1. $select = " select EXTRACT(HOUR from temp.fecha) as hora, count(*) as total
  2.         from (
  3.             select *
  4.             from ".$this->_name."
  5.             where fecha between '".$date."' AND ".$date_next."'
  6.             and root_cause like 'coldfusion.runtime.RequestTimedOutException%'
  7.         ) as temp
  8.         group by hora
  9.         order by 1;";
  10.  
  11.         $stmt =$this->_db->query($select);
  12.         $result = $stmt->fetchAll();
  13.  
  14.         return $result;

Saludos.