
05/04/2010, 12:35
|
Colaborador | | Fecha de Ingreso: marzo-2008 Ubicación: Cáceres
Mensajes: 3.735
Antigüedad: 16 años, 10 meses Puntos: 300 | |
Respuesta: telefonos repetidos. Te lo pongo para el select y del lado de tel1:
SELECT t1.tel1, IFNULL((t1.total+t2.total2),0)veces FROM (select tel1, count(tel1) total FROM tabla WHERE tel1 = '6645374' GROUP BY tel1)t1 LEFT JOIN
(select tel2, COUNT(tel2) total2 FROM tabla GROUP BY tel2)t2 ON t1.tel1 = t2.tel2
Creo que sabrás adaptarlo luego |