Probá con algo así:<div><br></div><div><div>SELECT <a href="http://news.id">news.id</a>, tit, cop, des, fecha, data.ruta AS img</div><div>FROM news</div><div>LEFT JOIN data</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>ON <a href="http://data.id">data.id</a> = (SELECT <a href="http://data.id">data.id</a> FROM data WHERE data.id_news=<a href="http://news.id">news.id</a> ORDER BY <a href="http://data.id">data.id</a> DESC LIMIT 1)</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>AND data.tipo = &#39;img&#39;</div><div>ORDER by news.fecha DESC, <a href="http://news.id">news.id</a> DESC</div><div><br></div><div>Igualmente, no estoy a favor de las subconsultas. En la mayoría de los casos se pueden evitar o reemplazar con algo mucho más eficiente. En un sitio con poco tráfico no son influyentes, pero a medida que el tráfico y la cantidad de consultas por página aumenta, se hace importante optimizar.</div>
<div><br></div><div>Igual, si te sirve una subconsulta, la hacemos funcionar y la optimizamos un poco (por el tema de los indices).</div><div><br></div><div>Saludos!</div><br><div class="gmail_quote">El 1 de octubre de 2010 18:43, Silverzero <span dir="ltr">&lt;<a href="mailto:silverzero.52@gmail.com">silverzero.52@gmail.com</a>&gt;</span> escribió:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Ahi mando!<br><br>Estructura de tabla para la tabla `data`<br>--<br><br>CREATE TABLE IF NOT EXISTS `data` (<br>  `id` int(11) NOT NULL auto_increment,<br>
  `id_news` int(11) NOT NULL,<br>  `ruta` text collate utf8_unicode_ci NOT NULL,<br>
  `tipo` varchar(50) collate utf8_unicode_ci NOT NULL,<br>  `titulo` varchar(255) collate utf8_unicode_ci NOT NULL,<br>  PRIMARY KEY  (`id`)<br>) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=17 ;<br>

<br>--<br>-- Volcar la base de datos para la tabla `data`<br>--<br><br>INSERT INTO `data` (`id`, `id_news`, `ruta`, `tipo`) VALUES<br>(13, 23, &#39;archivo.ppt&#39;, &#39;file),<br>(14, 23, &#39;img1.jpg&#39;, &#39;img&#39;),<br>

(15, 24, &#39;img2.jpg&#39;, &#39;img&#39;),<br>(16, 24, &#39;img3.jpg&#39;, &#39;img&#39;);<br><br>Estructura de tabla para la tabla `news`<br>--<br><br>CREATE TABLE IF NOT EXISTS `news` (<br>  `id` int(11) NOT NULL auto_increment,<br>

  `usr_id` int(11) NOT NULL,<br>  `fecha` date NOT NULL,<br>  `tit` varchar(255) collate utf8_unicode_ci NOT NULL,<br>  `cop` text collate utf8_unicode_ci NOT NULL,<br>  `des` text collate utf8_unicode_ci NOT NULL,<br>  PRIMARY KEY  (`id`)<br>

) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=25 ;<br><br>Volcar la base de datos para la tabla `news`<br><font color="#888888">--<br><br>INSERT INTO `news` (`id`, `usr_id`, `fecha`, `tit`, `cop`, `des`) VALUES<br>

(24, 1, &#39;2010-09-10&#39;, &#39;Lorem ipsum dolor sit amet, consectetuer adipiscing elit.  &#39;, &#39;Phasellus viverra nulla ut metus varius laoreet.  Quisque rutrum.  
Aenean imperdiet.  Etiam ultricies nisi vel augue.  Curabitur 
ullamcorper ultricies nisi.  Nam eget dui. 
Etiam rhoncus.  Maecenas tempus, tellus eget condimentum rhoncus, sem 
quam semper libero, sit amet adipiscing sem neque sed ipsum.&#39;, &#39; Nam quam nunc, blandit vel, luctus pulvinar, hendrerit id, lorem.  
Maecenas nec odio et ante tincidunt tempus.  Donec vitae sapien ut 
libero venenatis faucibus.  Nullam quis ante.  Etiam sit amet orci eget 
eros faucibus tincidunt.  Duis leo.  Sed fringilla mauris sit amet nibh.
  Donec sodales sagittis magna.  Sed consequat, leo eget bibendum 
sodales, augue velit cursus nunc, quis gravida magna mi a libero.  Fusce
 vulputate eleifend sapien.&#39;), (23, 1, &#39;2010-09-14&#39;, &#39;Lorem ipsum dolor sit amet, consectetuer adipiscing elit.  &#39;, 
&#39;Phasellus viverra nulla ut metus varius laoreet.  Quisque rutrum.  
Aenean imperdiet.  Etiam ultricies nisi vel augue.  Curabitur 
ullamcorper ultricies nisi.  Nam eget dui. 
Etiam rhoncus.  Maecenas tempus, tellus eget condimentum rhoncus, sem 
quam semper libero, sit amet adipiscing sem neque sed ipsum.&#39;, &#39; Nam 
quam nunc, blandit vel, luctus pulvinar, hendrerit id, lorem.  
Maecenas nec odio et ante tincidunt tempus.  Donec vitae sapien ut 
libero venenatis faucibus.  Nullam quis ante.  Etiam sit amet orci eget 
eros faucibus tincidunt.  Duis leo.  Sed fringilla mauris sit amet nibh.
  Donec sodales sagittis magna.  Sed consequat, leo eget bibendum 
sodales, augue velit cursus nunc, quis gravida magna mi a libero.  Fusce
 vulputate eleifend sapien.&#39;);</font><div><div></div><div class="h5"><br><br><br><br><div class="gmail_quote">2010/10/1 Leonardo Tadei - Pegasus Tech Supply <span dir="ltr">&lt;<a href="mailto:leonardot@pegasusnet.com.ar" target="_blank">leonardot@pegasusnet.com.ar</a>&gt;</span><br>

<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">Carolina,<br>
<div><br>
El vie, 01-10-2010 a las 13:06 -0300, Silverzero escribió:<br>
</div><div>&gt; No te dije que &quot;efecto&quot; era: me repite la misma imagen para todas las<br>
&gt; publicaciones listadas.<br>
<br>
</div>        Entonces falta algún alias para desambiguar un campo de la query<br>
respecto de la subquery...<br>
        De veras, mandá la estructura de las 2 tablas y un par de datos de<br>
pruebas y lo vemos!<br>
<div><div></div><div><br>
<br>
&gt; 2010/10/1 Silverzero &lt;<a href="mailto:silverzero.52@gmail.com" target="_blank">silverzero.52@gmail.com</a>&gt;<br>
&gt;         No anda lo que se te habia ocurrido...eso me hace el mismo<br>
&gt;         efecto que había hecho anteriormente con<br>
&gt;<br>
&gt;         SELECT<br>
&gt;                     <a href="http://news.id" target="_blank">news.id</a>,<br>
&gt;                     tit,<br>
&gt;                     cop,<br>
&gt;                     des,<br>
&gt;                     fecha,<br>
&gt;<br>
&gt;                     (SELECT ruta FROM data, news WHERE <a href="http://news.id" target="_blank">news.id</a>=id_news<br>
&gt;         LIMIT 0,1) as img<br>
&gt;<br>
&gt;                 FROM<br>
&gt;                     news<br>
&gt;                 LEFT JOIN<br>
&gt;                     data<br>
&gt;                 ON  <a href="http://news.id" target="_blank">news.id</a> = id_news AND tipo = &#39;img&#39;<br>
&gt;                 ORDER by<br>
&gt;                     fecha DESC,<br>
&gt;                     id DESC<br>
&gt;<br>
&gt;<br>
&gt;         Ya fué, lo dejo con GROUP BY, más adelante trataré de<br>
&gt;         resolverlo, porque seguro en algun momento voy a necesitar<br>
&gt;         listar algo con otro algo específico de un grupo en<br>
&gt;         particular.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;         2010/10/1 Leonardo Tadei - Pegasus Tech Supply<br>
&gt;         &lt;<a href="mailto:leonardot@pegasusnet.com.ar" target="_blank">leonardot@pegasusnet.com.ar</a>&gt;<br>
&gt;                 Entonces, una subquery con la forma:<br>
&gt;<br>
&gt;                 SELECT<br>
&gt;                             <a href="http://news.id" target="_blank">news.id</a>,<br>
&gt;                             tit,<br>
&gt;                             cop,<br>
&gt;                             des,<br>
&gt;                             fecha,<br>
&gt;                             ruta as img<br>
&gt;                         FROM<br>
&gt;                             news<br>
&gt;                         LEFT JOIN<br>
&gt;                             data<br>
&gt;<br>
&gt;                         ON  <a href="http://news.id" target="_blank">news.id</a> = (SELECT id_news FROM data WHERE<br>
&gt;                 <a href="http://news.id" target="_blank">news.id</a>=id_news<br>
&gt;                 LIMIT 0,1)<br>
&gt;                                AND tipo = &#39;img&#39;<br>
&gt;                         ORDER by<br>
&gt;                             fecha DESC,<br>
&gt;                             id DESC<br>
&gt;<br>
&gt;<br>
&gt;                        Es decir, hacés el LEFT JOIN relacionando<br>
&gt;                 <a href="http://news.id" target="_blank">news.id</a> con el resultado de<br>
&gt;                 una query que te devuelve solo un registro de data.<br>
&gt;                        Puede ser que haga falta usar algún alias para<br>
&gt;                 desambiguar algún campo,<br>
&gt;                 pero la idea es esa...<br>
&gt;<br>
&gt;                 El vie, 01-10-2010 a las 09:01 -0300, Silverzero<br>
&gt;                 escribió:<br>
&gt;<br>
&gt;                 &gt; Si, DISTINCT tambien lo había probado pero no me<br>
&gt;                 funcionó... :/<br>
&gt;                 &gt;<br>
&gt;                 &gt; 2010/10/1 Leonardo Tadei - Pegasus Tech Supply<br>
&gt;                 &gt; &lt;<a href="mailto:leonardot@pegasusnet.com.ar" target="_blank">leonardot@pegasusnet.com.ar</a>&gt;<br>
&gt;                 &gt;         Ahhh!!!<br>
&gt;                 &gt;<br>
&gt;                 &gt;         Entonces, sacale el LIMIT que te había<br>
&gt;                 dicho, y comenzá la<br>
&gt;                 &gt;         query con<br>
&gt;                 &gt;         SELECT DISTINCT ...<br>
&gt;                 &gt;<br>
&gt;                 &gt;                Sin embargo, tal vez esto no funcione<br>
&gt;                 porque en<br>
&gt;                 &gt;         realidad las filas no<br>
&gt;                 &gt;         estarán repetidas cuando haya distintas<br>
&gt;                 imágenes... probalo y<br>
&gt;                 &gt;         contanos,<br>
&gt;                 &gt;         y si no vamos a tener que armar una subquery<br>
&gt;                 que devuelva solo<br>
&gt;                 &gt;         un<br>
&gt;                 &gt;         registro por cada noticia.<br>
&gt;                 &gt;<br>
&gt;                 &gt;         El vie, 01-10-2010 a las 08:38 -0300,<br>
&gt;                 Silverzero escribió:<br>
&gt;                 &gt;<br>
&gt;                 &gt;         &gt; Si, pero en ese caso me lista una noticia<br>
&gt;                 sola, no?.<br>
&gt;                 &gt;         &gt; Yo quiero un listado completo de noticias<br>
&gt;                 por página, en<br>
&gt;                 &gt;         donde cada<br>
&gt;                 &gt;         &gt; noticia se muestra con ninguna (si no<br>
&gt;                 tuviese) o sólo una<br>
&gt;                 &gt;         imagen, para<br>
&gt;                 &gt;         &gt; que luego se pueda seleccionar una y ver<br>
&gt;                 todo el contenido<br>
&gt;                 &gt;         completo.<br>
&gt;                 &gt;         &gt;<br>
&gt;                 &gt;         &gt; 2010/10/1 Leonardo Tadei - Pegasus Tech<br>
&gt;                 Supply<br>
&gt;                 &gt;         &gt; &lt;<a href="mailto:leonardot@pegasusnet.com.ar" target="_blank">leonardot@pegasusnet.com.ar</a>&gt;<br>
&gt;                 &gt;         &gt;         Hola Carolina,<br>
&gt;                 &gt;         &gt;<br>
&gt;                 &gt;         &gt;                si solo querías la primer<br>
&gt;                 imagen, tu 1er<br>
&gt;                 &gt;         query estaba<br>
&gt;                 &gt;         &gt;         bien, solo que al<br>
&gt;                 &gt;         &gt;         final tenías que agregarle un<br>
&gt;                 LIMIT 0,1<br>
&gt;                 &gt;         &gt;<br>
&gt;                 &gt;         &gt;                El LIMIT es a toda la<br>
&gt;                 query...<br>
&gt;                 &gt;         &gt;<br>
&gt;                 &gt;         &gt;         El vie, 01-10-2010 a las 07:30<br>
&gt;                 -0300, Silverzero<br>
&gt;                 &gt;         escribió:<br>
&gt;                 &gt;         &gt;<br>
&gt;                 &gt;         &gt;         &gt; No, solo una. Porque es para el<br>
&gt;                 listado de todas<br>
&gt;                 &gt;         las<br>
&gt;                 &gt;         &gt;         noticias, y<br>
&gt;                 &gt;         &gt;         &gt; queria que se mostrara cada una<br>
&gt;                 con una imagen de<br>
&gt;                 &gt;         todas las<br>
&gt;                 &gt;         &gt;         que<br>
&gt;                 &gt;         &gt;         &gt; tuviera asociadas (hubiera sido<br>
&gt;                 ideal la de menor<br>
&gt;                 &gt;         ID).<br>
&gt;                 &gt;         &gt;         &gt;<br>
&gt;                 &gt;         &gt;         &gt; 2010/10/1 Leonardo Tadei -<br>
&gt;                 Pegasus Tech Supply<br>
&gt;                 &gt;         &gt;         &gt; &lt;<a href="mailto:leonardot@pegasusnet.com.ar" target="_blank">leonardot@pegasusnet.com.ar</a>&gt;<br>
&gt;                 &gt;         &gt;         &gt;         Pero esa query no te<br>
&gt;                 devuelve todas las<br>
&gt;                 &gt;         imágenes...<br>
&gt;                 &gt;         &gt;         no te<br>
&gt;                 &gt;         &gt;         &gt;         hacían falta<br>
&gt;                 &gt;         &gt;         &gt;         todas???<br>
&gt;                 &gt;         &gt;         &gt;<br>
&gt;                 &gt;         &gt;         &gt;         El vie, 01-10-2010 a las<br>
&gt;                 00:24 -0300,<br>
&gt;                 &gt;         Silverzero<br>
&gt;                 &gt;         &gt;         escribió:<br>
&gt;                 &gt;         &gt;         &gt;<br>
&gt;                 &gt;         &gt;         &gt;         &gt; Hola Leo,<br>
&gt;                 &gt;         &gt;         &gt;         &gt;<br>
&gt;                 &gt;         &gt;         &gt;         &gt; Gracias por la<br>
&gt;                 respuesta.<br>
&gt;                 &gt;         &gt;         &gt;         &gt; Lo arreglé así:<br>
&gt;                 &gt;         &gt;         &gt;         &gt;<br>
&gt;                 &gt;         &gt;         &gt;         &gt;     $qry=&quot;SELECT<br>
&gt;                 &gt;         &gt;         &gt;         &gt;             <a href="http://news.id" target="_blank">news.id</a>,<br>
&gt;                 &gt;         &gt;         &gt;         &gt;             tit,<br>
&gt;                 &gt;         &gt;         &gt;         &gt;             cop,<br>
&gt;                 &gt;         &gt;         &gt;         &gt;             des,<br>
&gt;                 &gt;         &gt;         &gt;         &gt;             fecha,<br>
&gt;                 &gt;         &gt;         &gt;         &gt;             ruta as<br>
&gt;                 img<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         FROM<br>
&gt;                 &gt;         &gt;         &gt;         &gt;             news<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         LEFT JOIN<br>
&gt;                 &gt;         &gt;         &gt;         &gt;             data<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         ON<br>
&gt;                 &gt;         &gt;         &gt;         &gt;             <a href="http://news.id" target="_blank">news.id</a> =<br>
&gt;                 id_news AND tipo =<br>
&gt;                 &gt;         &#39;img&#39;<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         GROUP BY<br>
&gt;                 &gt;         &gt;         &gt;         &gt;             <a href="http://news.id" target="_blank">news.id</a><br>
&gt;                 &gt;         &gt;         &gt;         &gt;         ORDER by<br>
&gt;                 &gt;         &gt;         &gt;         &gt;             fecha<br>
&gt;                 DESC,<br>
&gt;                 &gt;         &gt;         &gt;         &gt;             id DESC&quot;;<br>
&gt;                 &gt;         &gt;         &gt;         &gt;<br>
&gt;                 &gt;         &gt;         &gt;         &gt; Lo único es que me<br>
&gt;                 elige una imagen a<br>
&gt;                 &gt;         criterio<br>
&gt;                 &gt;         &gt;         desconocido,<br>
&gt;                 &gt;         &gt;         &gt;         pero me da<br>
&gt;                 &gt;         &gt;         &gt;         &gt; la impresión que es<br>
&gt;                 una con el id<br>
&gt;                 &gt;         intermedio<br>
&gt;                 &gt;         &gt;         porque nunca es<br>
&gt;                 &gt;         &gt;         &gt;         la mayor<br>
&gt;                 &gt;         &gt;         &gt;         &gt; ni la menor.<br>
&gt;                 &gt;         &gt;         &gt;         &gt;<br>
&gt;                 &gt;         &gt;         &gt;         &gt; 2010/9/30 Leonardo<br>
&gt;                 Tadei - Pegasus Tech<br>
&gt;                 &gt;         Supply<br>
&gt;                 &gt;         &gt;         &gt;         &gt;<br>
&gt;                 &lt;<a href="mailto:leonardot@pegasusnet.com.ar" target="_blank">leonardot@pegasusnet.com.ar</a>&gt;<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         Hola Carolina,<br>
&gt;                 &gt;         &gt;         &gt;         &gt;<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         El jue,<br>
&gt;                 30-09-2010 a las 21:07<br>
&gt;                 &gt;         -0300,<br>
&gt;                 &gt;         &gt;         Silverzero<br>
&gt;                 &gt;         &gt;         &gt;         escribió:<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         &gt; Hola tengo<br>
&gt;                 un problema con una<br>
&gt;                 &gt;         consulta<br>
&gt;                 &gt;         &gt;         a dos<br>
&gt;                 &gt;         &gt;         &gt;         tablas (que<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         seguro es<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         &gt; una pavada y<br>
&gt;                 yo no la veo), en<br>
&gt;                 &gt;         una tengo<br>
&gt;                 &gt;         &gt;         noticias<br>
&gt;                 &gt;         &gt;         &gt;         y en otra<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         guardo<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         &gt; archivos,<br>
&gt;                 videos e imagenes de<br>
&gt;                 &gt;         cada<br>
&gt;                 &gt;         &gt;         noticia, que<br>
&gt;                 &gt;         &gt;         &gt;         pueden ser,<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         ninguna o<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         &gt; más de una.<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         &gt; Cuando listo<br>
&gt;                 las noticias<br>
&gt;                 &gt;         quiero que se<br>
&gt;                 &gt;         &gt;         vea UNA de<br>
&gt;                 &gt;         &gt;         &gt;         las fotos<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         (la de ID<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         &gt; menor),<br>
&gt;                 titulo, fecha,<br>
&gt;                 &gt;         &gt;         copete/desarrollo. Pero<br>
&gt;                 &gt;         &gt;         &gt;         cuando una<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         noticia<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         &gt; tiene más de<br>
&gt;                 una imagen me<br>
&gt;                 &gt;         lista la<br>
&gt;                 &gt;         &gt;         noticia<br>
&gt;                 &gt;         &gt;         &gt;         repetida tantas<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         veces como<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         &gt; imágenes<br>
&gt;                 haya asociadas.<br>
&gt;                 &gt;         &gt;         &gt;         &gt;<br>
&gt;                 &gt;         &gt;         &gt;         &gt;<br>
&gt;                 &gt;         &gt;         &gt;         &gt;                Esto<br>
&gt;                 está bien, y es como<br>
&gt;                 &gt;         se espera<br>
&gt;                 &gt;         &gt;         que<br>
&gt;                 &gt;         &gt;         &gt;         funcione una<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         query:<br>
&gt;                 creciendo<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         &quot;para abajo&quot;<br>
&gt;                 con tantos<br>
&gt;                 &gt;         registros como<br>
&gt;                 &gt;         &gt;         datos tenga<br>
&gt;                 &gt;         &gt;         &gt;         la<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         respuesta.<br>
&gt;                 &gt;         &gt;         &gt;         &gt;                Por lo<br>
&gt;                 que planteás, es<br>
&gt;                 &gt;         como que<br>
&gt;                 &gt;         &gt;         esperás que<br>
&gt;                 &gt;         &gt;         &gt;         la<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         respuesta &quot;se<br>
&gt;                 más<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         ancha&quot;, es<br>
&gt;                 decir, tenga más<br>
&gt;                 &gt;         columnas, pero<br>
&gt;                 &gt;         &gt;         nunca vas<br>
&gt;                 &gt;         &gt;         &gt;         a tener<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         más<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         columnas que<br>
&gt;                 las que estés<br>
&gt;                 &gt;         proyectando.<br>
&gt;                 &gt;         &gt;         &gt;         &gt;<br>
&gt;                 &gt;         &gt;         &gt;         &gt;                La<br>
&gt;                 solución a aplicar es<br>
&gt;                 &gt;         &gt;         programática: en la<br>
&gt;                 &gt;         &gt;         &gt;         primer<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         iteración de<br>
&gt;                 la<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         query, rescatá<br>
&gt;                 los datos de<br>
&gt;                 &gt;         News, y de la<br>
&gt;                 &gt;         &gt;         1ra y las<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         siguientes,<br>
&gt;                 usá solo<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         los datos<br>
&gt;                 proyectados de Data.<br>
&gt;                 &gt;         &gt;         &gt;         &gt;<br>
&gt;                 &gt;         &gt;         &gt;         &gt;<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         &gt; Mi consulta<br>
&gt;                 original es<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         &gt;<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         &gt;<br>
&gt;                 $qry=&quot;SELECT<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         &gt;<br>
&gt;                 <a href="http://news.id" target="_blank">news.id</a>,<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         &gt;<br>
&gt;                 tit,<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         &gt;<br>
&gt;                 cop,<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         &gt;<br>
&gt;                 des,<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         &gt;<br>
&gt;                 fecha,<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         &gt;<br>
&gt;                 ruta as img<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         &gt;         FROM<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         &gt;<br>
&gt;                 news<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         &gt;         LEFT<br>
&gt;                 JOIN<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         &gt;<br>
&gt;                 data<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         &gt;         ON<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         &gt;<br>
&gt;                 <a href="http://news.id" target="_blank">news.id</a> = id_news<br>
&gt;                 &gt;         AND tipo =<br>
&gt;                 &gt;         &gt;         &#39;img&#39;<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         &gt;<br>
&gt;                 ORDER by<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         &gt;<br>
&gt;                 fecha DESC,<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         &gt;<br>
&gt;                 id DESC&quot;;<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         &gt;<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         &gt; Había<br>
&gt;                 probado hacer una<br>
&gt;                 &gt;         consulta anidada<br>
&gt;                 &gt;         &gt;         en<br>
&gt;                 &gt;         &gt;         &gt;         reemplazo de<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         ruta as img,<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         &gt; por SELECT<br>
&gt;                 ruta FROM news,<br>
&gt;                 &gt;         data WHERE<br>
&gt;                 &gt;         &gt;         <a href="http://news.id" target="_blank">news.id</a> =<br>
&gt;                 &gt;         &gt;         &gt;         id_news AND<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         tipo =<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         &gt; &#39;img&#39; LIMIT<br>
&gt;                 0,1, para que me<br>
&gt;                 &gt;         devuelva<br>
&gt;                 &gt;         &gt;         una sola,<br>
&gt;                 &gt;         &gt;         &gt;         pero se me<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         repite la<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         &gt; misma imagen<br>
&gt;                 en cada<br>
&gt;                 &gt;         noticia...<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         &gt;<br>
&gt;                 &gt;         &gt;         &gt;         &gt;         &gt; Gracias<br>
&gt;                 &gt;         &gt;         &gt;         &gt;<br>
&gt;                 &gt;         &gt;         &gt;         &gt;<br>
&gt;                 &gt;         &gt;         &gt;         &gt;                Por<br>
&gt;                 nada!<br>
&gt;                 &gt;         &gt;         &gt;         &gt;                (si se<br>
&gt;                 entiende)<br>
&gt;                 &gt;         &gt;<br>
&gt;                 &gt;         &gt;         &gt;<br>
&gt;                 &gt;         &gt;         --<br>
&gt;                 &gt;         &gt;<br>
&gt;                 &gt;         &gt;         Leonardo Tadei<br>
&gt;                 &gt;         &gt;         <a href="mailto:leonardot@pegasusnet.com.ar" target="_blank">leonardot@pegasusnet.com.ar</a><br>
&gt;                 &gt;         &gt;         <a href="http://blog.pegasusnet.com.ar" target="_blank">http://blog.pegasusnet.com.ar</a><br>
&gt;                 &gt;         &gt;         Firma pública:<br>
&gt;                 &gt;         &gt;<br>
&gt;                 &gt;<br>
&gt;                 <a href="http://www.pegasusnet.com.ar/LeonardoTadei-public.key" target="_blank">http://www.pegasusnet.com.ar/LeonardoTadei-public.key</a><br>
&gt;                 &gt;         &gt;<br>
&gt;                 &gt;         &gt;<br>
&gt;                 _______________________________________________<br>
&gt;                 &gt;         &gt;         Php-avanzado mailing list<br>
&gt;                 &gt;         &gt;         <a href="mailto:Php-avanzado@pato2.fi.mdp.edu.ar" target="_blank">Php-avanzado@pato2.fi.mdp.edu.ar</a><br>
&gt;                 &gt;         &gt;<br>
&gt;                 &gt;<br>
&gt;                 <a href="http://www3.fi.mdp.edu.ar/cgi-bin/mailman/listinfo/php-avanzado" target="_blank">http://www3.fi.mdp.edu.ar/cgi-bin/mailman/listinfo/php-avanzado</a><br>
&gt;                 &gt;         &gt;<br>
&gt;                 &gt;         &gt;<br>
&gt;                 &gt;         &gt;<br>
&gt;                 &gt;         &gt;<br>
&gt;                 &gt;         &gt; --<br>
&gt;                 &gt;         &gt; Carolina Derromediz<br>
&gt;                 &gt;         &gt; Cel. +54 223 5301599<br>
&gt;                 &gt;         &gt;<br>
&gt;                 _______________________________________________<br>
&gt;                 &gt;         &gt; Php-avanzado mailing list<br>
&gt;                 &gt;         &gt; <a href="mailto:Php-avanzado@pato2.fi.mdp.edu.ar" target="_blank">Php-avanzado@pato2.fi.mdp.edu.ar</a><br>
&gt;                 &gt;         &gt;<br>
&gt;                 &gt;<br>
&gt;                 <a href="http://www3.fi.mdp.edu.ar/cgi-bin/mailman/listinfo/php-avanzado" target="_blank">http://www3.fi.mdp.edu.ar/cgi-bin/mailman/listinfo/php-avanzado</a><br>
&gt;                 &gt;         --<br>
&gt;                 &gt;<br>
&gt;                 &gt;         Leonardo Tadei<br>
&gt;                 &gt;         <a href="mailto:leonardot@pegasusnet.com.ar" target="_blank">leonardot@pegasusnet.com.ar</a><br>
&gt;                 &gt;         <a href="http://blog.pegasusnet.com.ar" target="_blank">http://blog.pegasusnet.com.ar</a><br>
&gt;                 &gt;         Firma pública:<br>
&gt;                 &gt;<br>
&gt;                 <a href="http://www.pegasusnet.com.ar/LeonardoTadei-public.key" target="_blank">http://www.pegasusnet.com.ar/LeonardoTadei-public.key</a><br>
&gt;                 &gt;<br>
&gt;                 &gt;<br>
&gt;                 _______________________________________________<br>
&gt;                 &gt;         Php-avanzado mailing list<br>
&gt;                 &gt;         <a href="mailto:Php-avanzado@pato2.fi.mdp.edu.ar" target="_blank">Php-avanzado@pato2.fi.mdp.edu.ar</a><br>
&gt;                 &gt;<br>
&gt;                 <a href="http://www3.fi.mdp.edu.ar/cgi-bin/mailman/listinfo/php-avanzado" target="_blank">http://www3.fi.mdp.edu.ar/cgi-bin/mailman/listinfo/php-avanzado</a><br>
&gt;                 &gt;<br>
&gt;                 &gt;<br>
&gt;                 &gt;<br>
&gt;                 &gt;<br>
&gt;                 &gt; --<br>
&gt;                 &gt; Carolina Derromediz<br>
&gt;                 &gt; Cel. +54 223 5301599<br>
&gt;                 &gt; _______________________________________________<br>
&gt;                 &gt; Php-avanzado mailing list<br>
&gt;                 &gt; <a href="mailto:Php-avanzado@pato2.fi.mdp.edu.ar" target="_blank">Php-avanzado@pato2.fi.mdp.edu.ar</a><br>
&gt;                 &gt;<br>
&gt;                 <a href="http://www3.fi.mdp.edu.ar/cgi-bin/mailman/listinfo/php-avanzado" target="_blank">http://www3.fi.mdp.edu.ar/cgi-bin/mailman/listinfo/php-avanzado</a><br>
&gt;                 --<br>
&gt;<br>
&gt;<br>
&gt;                 Leonardo Tadei<br>
&gt;                 <a href="mailto:leonardot@pegasusnet.com.ar" target="_blank">leonardot@pegasusnet.com.ar</a><br>
&gt;<br>
&gt;                 Pegasus Tech Supply<br>
&gt;                 Tel: (+54)(+223) 471-2880<br>
&gt;                 La Salle 1131 - Mar del Plata - Argentina<br>
&gt;                 <a href="http://www.pegasusnet.com.ar" target="_blank">http://www.pegasusnet.com.ar</a> /<br>
&gt;                 <a href="http://blog.pegasusnet.com.ar" target="_blank">http://blog.pegasusnet.com.ar</a><br>
&gt;                 <a href="http://www.prometeustech.com.ar" target="_blank">http://www.prometeustech.com.ar</a> /<br>
&gt;                 <a href="http://www.grupopegasus.com" target="_blank">http://www.grupopegasus.com</a><br>
&gt;<br>
&gt;                 Firma pública:<br>
&gt;                 <a href="http://www.pegasusnet.com.ar/LeonardoTadei-public.key" target="_blank">http://www.pegasusnet.com.ar/LeonardoTadei-public.key</a><br>
&gt;<br>
&gt;<br>
&gt;                 _______________________________________________<br>
&gt;                 Php-avanzado mailing list<br>
&gt;                 <a href="mailto:Php-avanzado@pato2.fi.mdp.edu.ar" target="_blank">Php-avanzado@pato2.fi.mdp.edu.ar</a><br>
&gt;                 <a href="http://www3.fi.mdp.edu.ar/cgi-bin/mailman/listinfo/php-avanzado" target="_blank">http://www3.fi.mdp.edu.ar/cgi-bin/mailman/listinfo/php-avanzado</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;         --<br>
&gt;<br>
&gt;         Carolina Derromediz<br>
&gt;         Cel. +54 223 5301599<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Carolina Derromediz<br>
&gt; Cel. +54 223 5301599<br>
&gt; _______________________________________________<br>
&gt; Php-avanzado mailing list<br>
&gt; <a href="mailto:Php-avanzado@pato2.fi.mdp.edu.ar" target="_blank">Php-avanzado@pato2.fi.mdp.edu.ar</a><br>
&gt; <a href="http://www3.fi.mdp.edu.ar/cgi-bin/mailman/listinfo/php-avanzado" target="_blank">http://www3.fi.mdp.edu.ar/cgi-bin/mailman/listinfo/php-avanzado</a><br>
--<br>
<br>
Leonardo Tadei<br>
<a href="mailto:leonardot@pegasusnet.com.ar" target="_blank">leonardot@pegasusnet.com.ar</a><br>
<a href="http://blog.pegasusnet.com.ar" target="_blank">http://blog.pegasusnet.com.ar</a><br>
Firma pública: <a href="http://www.pegasusnet.com.ar/LeonardoTadei-public.key" target="_blank">http://www.pegasusnet.com.ar/LeonardoTadei-public.key</a><br>
<br>
_______________________________________________<br>
Php-avanzado mailing list<br>
<a href="mailto:Php-avanzado@pato2.fi.mdp.edu.ar" target="_blank">Php-avanzado@pato2.fi.mdp.edu.ar</a><br>
<a href="http://www3.fi.mdp.edu.ar/cgi-bin/mailman/listinfo/php-avanzado" target="_blank">http://www3.fi.mdp.edu.ar/cgi-bin/mailman/listinfo/php-avanzado</a><br>
</div></div></blockquote></div><br><br clear="all"><br></div></div>-- <br><div><div></div><div class="h5">Carolina Derromediz<br>Cel. +54 223 5301599<br>
</div></div><br>_______________________________________________<br>
Php-avanzado mailing list<br>
<a href="mailto:Php-avanzado@pato2.fi.mdp.edu.ar">Php-avanzado@pato2.fi.mdp.edu.ar</a><br>
<a href="http://www3.fi.mdp.edu.ar/cgi-bin/mailman/listinfo/php-avanzado" target="_blank">http://www3.fi.mdp.edu.ar/cgi-bin/mailman/listinfo/php-avanzado</a><br></blockquote></div><br><br clear="all"><br>-- <br>Matias Fernando Gea<br>
<a href="mailto:matigea@gmail.com">matigea@gmail.com</a><br><a href="http://www.mfgea.com.ar">http://www.mfgea.com.ar</a><br>
</div>