Ver Mensaje Individual
  #4 (permalink)  
Antiguo 27/06/2011, 13:55
alexg88
 
Fecha de Ingreso: abril-2011
Mensajes: 1.342
Antigüedad: 13 años, 1 mes
Puntos: 344
Respuesta: Problema con count(*) de registros de tablas

Prueba a renombrar la subconsulta a ver si así te funciona.

Código SQL:
Ver original
  1. SELECT SUM(cuenta)
  2. FROM
  3. (SELECT COUNT(*) AS cuenta FROM ANIMALES INNER JOIN PERROS ON
  4. ANIMALES.ID_ANIMAL=PERROS.ID_PERRO WHERE UBICACION LIKE 'EDO.MEX'
  5. UNION
  6. SELECT COUNT(*) *AS cuenta FROM ANIMALES INNER JOIN GATOS ON
  7. ANIMALES.ID_ANIMAL=GATOS.ID_GATO WHERE UBICACION LIKE 'EDO.MEX')
  8. AS subconsulta