Ver Mensaje Individual
  #2 (permalink)  
Antiguo 16/12/2013, 10:40
xoceunder
 
Fecha de Ingreso: junio-2012
Ubicación: En el Mundo
Mensajes: 759
Antigüedad: 11 años, 10 meses
Puntos: 10
Respuesta: consultar varias tablas registro multiples

ok ya solucione como poder buscar en barias tablas aqui dejo por si otro puede hacerle falta

Código SQL:
Ver original
  1. SELECT account, COUNT( * ) AS duplica
  2. FROM (
  3. SELECT account
  4. FROM bd1.accounts
  5. UNION ALL SELECT account
  6. FROM bd2.accounts
  7. UNION ALL SELECT account
  8. FROM bd3.accounts
  9. UNION ALL SELECT account
  10. FROM bd4.accounts
  11. ) AS todo
  12. GROUP BY account
  13. HAVING COUNT( * ) >1
  14. LIMIT 0 , 50