
20/09/2005, 04:57
|
| | Fecha de Ingreso: diciembre-2003 Ubicación: Málaga
Mensajes: 495
Antigüedad: 21 años, 3 meses Puntos: 0 | |
consulta mysql Buenas tengo esta consulta:
select a.email,a.id,b.group_name,a.group_id from email_users a, email_group b where a.email like '%p%' and a.group_id=b.id and group_id<>4 and a.email not in (select email from email_users where group_id=4)
pero quiero ademas q cuando la haga me sake los distintos emails he probado con:
select distinct(a.email),a.id,b.group_name,a.group_id from email_users a, email_group b where a.email like '%p%' and a.group_id=b.id and group_id<>4 and a.email not in (select email from email_users where group_id=4)
select a.email,a.id,b.group_name,a.group_id from email_users a, email_group b where a.email like '%p%' and a.group_id=b.id and group_id<>4 and a.email not in (select distinct(email) from email_users where group_id=4)
Pero ninguna d las 2 funciona, como se podria?? |