SELECT DISTINCT (t1.c),t2.m FROM t1 right JOIN t2 ON (t1.c=t2.c) group by t1.c;
agregandole un group by te devuelve lo que querés.
El 19/09/05, Javier C. G.<feod...@yahoo.com> escribió:
hola.
Supongamos que tengo las siguientes tablas.
t1
-------
c
------
1
2
3
4
5
--------
t2
------
c m
------
2 a
2 b
2 c
3 w
3 x
3 y
--------
la consulta "SELECT DISTINCT (t1.c),t2.m FROM t1 LEFT
JOIN t2 ON (t1.c=t2.c)" de retorna.
res
-----
t1.c t2.m
------------
2 a
2 b
2 c
3 w
3 x
3 y
------------
Los que quiero es como sigue:
res
-----
t1.c t2.m
------------
2 a
3 w
------------
Alguien sabe como seria una consulta para obtener el
resultado anterior?
Gracias!!