Acabo de responderme vía "San Google".
Sólo tengo que agregarle al primer SELECT un "ORDER BY t1.dato LIMIT 1"
Queda así:
Código sql:
Ver originalSELECT c1.variable, c2.count1, c3.count2, c4.count3, c5.count4, c6.count5 FROM
(SELECT t1.dato AS variable FROM tabla1 AS t1 WHERE t1.llave = 4 ORDER BY t1.dato LIMIT 1) AS c1,
(SELECT COUNT(t2.dato) AS count1 FROM tabla2 AS t2 WHERE t2.llave = 4) AS c2,
(SELECT COUNT(t3.dato) AS count2 FROM tabla3 AS t3 WHERE t3.llave = 4) AS c3,
(SELECT COUNT(t4.dato) AS count3 FROM tabla4 AS t4 WHERE t4.llave = 4) AS c4,
(SELECT COUNT(t5.dato) AS count4 FROM tabla5 AS t5 WHERE t5.llave = 4) AS c5,
(SELECT COUNT(t6.dato) AS count5 FROM tabla6 AS t6 WHERE t6.llave = 4) AS c6;
Y muestra el resultado así:
Código:
Variable | COUNT1 | COUNT2 | COUNT3 | COUNT4 | COUNT5
-------+---------------------------------------------------------------------
4 | 1 | 1 | 1 | 1 | 1
A lo mejor a alguien le puede servir.
Gracias de todas formas, comparto mi duda y solución con Uds. pues me han ayudado bastante.
Saludos