› Foros › PC › Software libre
A Fecha Usuario
=============================
3729 2014-03-01 15:02:33 9001
3729 2014-03-01 15:04:03 9001
3729 2014-03-01 15:04:08 9001
3729 2014-03-01 15:04:32 9001
3729 2014-03-01 15:09:32 1068
3729 2014-03-01 15:09:37 9001
3729 2014-03-01 15:17:04 1068
3729 2014-03-12 10:02:00 9001
3729 2014-03-12 10:02:40 1068
3729 2014-03-21 14:21:27 9001
3729 2014-03-21 14:23:00 1068
3729 2014-03-28 10:30:12 9001
3729 2014-03-28 10:31:55 1068
3729 2014-04-02 10:16:30 9001
3729 2014-04-02 10:16:58 1068
3729 2014-04-09 12:56:50 1068
3741 2014-03-01 15:52:56 1068
3741 2014-03-01 15:52:57 9001
3741 2014-03-01 15:55:43 1068
3741 2014-03-04 10:25:12 9001
3741 2014-03-04 10:28:16 1068
3741 2014-03-07 11:04:00 9001
3741 2014-03-07 11:05:32 1068
3741 2014-03-20 10:38:19 9001
3741 2014-03-20 10:39:55 1068
3741 2014-03-24 10:13:16 9001
3741 2014-03-24 10:15:33 1068
3741 2014-04-01 10:40:40 9001
3741 2014-04-01 10:40:55 1068
3741 2014-04-09 12:55:36 1068
3745 2014-03-01 16:30:29 1068
3745 2014-03-01 16:30:34 9001
3745 2014-03-01 16:31:42 1068
3745 2014-03-03 12:00:52 9001
3745 2014-03-03 12:01:52 9001
3745 2014-03-03 12:05:38 1068
3745 2014-04-01 10:24:42 1068
3745 2014-04-07 11:11:49 9001
3745 2014-04-07 11:12:15 1068
3745 2014-04-07 12:26:37 9001
3745 2014-04-07 12:27:47 1068
5602 2014-03-05 13:20:40 9001
5602 2014-03-05 13:29:44 9001
5602 2014-03-05 13:31:29 1068
5602 2014-03-10 11:15:56 9001
5602 2014-03-10 11:16:46 1068
5602 2014-04-08 14:37:27 9001
5602 2014-04-08 14:38:57 1068
6410 2014-03-06 11:08:12 9001
6410 2014-03-06 11:10:14 9001
6410 2014-03-06 11:52:43 1068
6410 2014-03-11 11:03:57 9001
6410 2014-03-11 11:11:03 1068
6410 2014-03-11 13:13:23 9001
6410 2014-03-11 13:15:45 1068
6410 2014-03-24 13:08:39 9001
6410 2014-03-24 13:10:17 1068
6410 2014-04-07 10:43:16 9001
6410 2014-04-07 10:43:58 1068
6410 2014-04-07 11:45:07 9001
6410 2014-04-07 11:47:18 1068
6443 2014-03-06 12:05:35 9001
6443 2014-03-06 12:09:10 9001
6443 2014-03-06 12:14:27 1068
6443 2014-03-06 12:17:38 1068
6443 2014-03-06 12:54:03 9001
6443 2014-03-06 13:18:50 1068
6443 2014-03-22 12:44:24 9001
6443 2014-04-09 11:34:20 9001
6443 2014-04-09 11:34:49 1068
6788 2014-03-07 13:41:42 9001
6788 2014-03-07 13:51:09 1068
6788 2014-03-19 10:05:29 9001
6788 2014-03-19 10:06:16 1068
6788 2014-03-24 10:16:19 9001
6788 2014-03-24 10:17:07 1068
6788 2014-03-24 10:17:08 9001
6788 2014-03-24 10:17:24 1068
6788 2014-04-01 10:30:22 9001
6788 2014-04-01 10:30:48 1068
SELECT
MIN(fecha),usuario
FROM tabla
WHERE
usuario!=9001
GROUP BY A
SELECT A, Fecha, Usuario
FROM tabla
WHERE Fecha IN (SELECT MIN(Fecha)
FROM tabla
WHERE Usuario != 9001
GROUP BY A);
SELECT MIN(fecha), usuario
FROM tabla
WHERE usuario!=9001
GROUP BY A, usuario;
laparra escribió:Así a bote pronto creo que tienes un fallo, según dice mi profe de bases de datos, no puedes usar la funcion "MIN()" que devuelve un solo resultado, junto con "Usuario" que devuelve más de un resultado.
Salu2.