Código MySQL:
Requiero mostrar los ultimos valores ordenados por fechas, asi que agrupo por 'idtarea', así;Ver original
+----+---------+-------+---------------------+ +----+---------+-------+---------------------+ | 15 | 55 | 20 | 2010-12-06 00:00:00 | | 16 | 56 | 54 | 2010-12-06 00:00:00 | | 17 | 59 | 90 | 2010-12-06 00:00:00 | | 18 | 60 | 80 | 2010-12-06 00:00:00 | | 19 | 61 | 70 | 2010-08-04 00:00:00 | | 20 | 61 | 70 | 2010-12-06 00:00:00 | | 21 | 62 | 15 | 2010-12-06 00:00:00 | | 22 | 63 | 67 | 2010-12-06 00:00:00 | | 23 | 64 | 8 | 2010-12-06 00:00:00 | | 24 | 65 | 80 | 2010-12-06 00:00:00 | | 25 | 71 | 50 | 2010-12-06 00:00:00 | | 26 | 72 | 80 | 2010-12-06 00:00:00 | | 27 | 70 | 30 | 2010-12-06 00:00:00 | | 28 | 57 | 50 | 2010-12-06 00:00:00 | | 29 | 58 | 0 | 2010-12-06 15:50:45 | | 30 | 58 | 50 | 2010-12-06 18:50:01 | | 14 | 55 | 10 | 2010-09-14 00:00:00 | +----+---------+-------+---------------------+
Código MySQL:
Si ven detenidamente la fecha está bien, pero el 'id' debería ser 30 y el valor debería ser 50, debo realizar una subconsulta para lograr mi propósito?, agradecería algúna idea Ver original
+----+---------+-------+---------------------+ +----+---------+-------+---------------------+ | 15 | 55 | 20 | 2010-12-06 00:00:00 | | 16 | 56 | 54 | 2010-12-06 00:00:00 | | 28 | 57 | 50 | 2010-12-06 00:00:00 | | 29 | 58 | 0 | 2010-12-06 18:50:01 | /* eL valor debería ser 50 */ | 17 | 59 | 90 | 2010-12-06 00:00:00 | | 18 | 60 | 80 | 2010-12-06 00:00:00 | | 19 | 61 | 70 | 2010-12-06 00:00:00 | | 21 | 62 | 15 | 2010-12-06 00:00:00 | | 22 | 63 | 67 | 2010-12-06 00:00:00 | | 23 | 64 | 8 | 2010-12-06 00:00:00 | | 24 | 65 | 80 | 2010-12-06 00:00:00 | | 27 | 70 | 30 | 2010-12-06 00:00:00 | | 25 | 71 | 50 | 2010-12-06 00:00:00 | | 26 | 72 | 80 | 2010-12-06 00:00:00 | +----+---------+-------+---------------------+