/**
      * @return Objednavka
      */
     public static function getInstance()
     {          
          if ( null === self::$_instance )
          { 
               // Pripojeni k DB – pripojuje se na jinou db nez cely web, db proeshop_base, viz config
               $config = Zend_Registry::get(‘config’);
               $db_proeshop_base = Zend_Db::factory($config->db_proeshop_base->adapter, $config->db_proeshop_base->toArray());
 
               self::$_instance = new self($db_proeshop_base);
               self::$_instance->getAdapter()->query(“SET CHARACTER SET UTF8″);
          }     
          return self::$_instance;
     }

Join na tabulku, ze které potřebuju jen jeden řádek

SELECT
   e.jmeno,
   e.id,
   v.*
FROM
   ekostrazce AS e
JOIN vysledek_testu AS v
ON e.id = v.ekostrazce_id
   AND v.id = (
       SELECT
         id
      FROM
         vysledek_testu
      WHERE
        ekostrazce_id = e.id
      ORDER BY
        vysledek DESC,
       cas ASC
     LIMIT 1
)
LIMIT {$limit}