Ver Mensaje Individual
  #1 (permalink)  
Antiguo 14/10/2010, 16:07
Avatar de rocka8613
rocka8613
 
Fecha de Ingreso: abril-2010
Mensajes: 33
Antigüedad: 14 años
Puntos: 0
Contar registros en relacion muchos a muchos

Hola a todos, les planteo mi inquietud de la siguiente manera, poseo 4 tablas relacionadas de uno a muchos seguidas unas de otras asi:

Tabla1 CATEGORÍA
Tabla2 SUBCATEGORÍA
Tabla3 TEMA
Tabla4 OBJETO

como les plantee la relación es de muchos a muchos, una CATEGORÍA tienes muchas SUBCATEGORÍA y esta muchos TEMA, y así sucesivamente

si por ejemplo tengo los siguientes registros k me listan tal cual, si yo kisiera poner al lado de cada registro como esta en paréntesis, la cantidad de registros tipo OBJETO que contienen

CATEGORÍA
-c1 (4)
-c2 (3)
-c3 (2)

CATEGORISMO
-s1c1 (4)
-s2c1 (0)
-s3c2 (3)
-s4c3 (2)

TEMA
-t1s1 (3)
-t2s1 (1)
-t3s3 (0)
-t4s3 (3)
-t5s4 (1)
-t6s4 (1)

OBJETO
-o1t1
-o2t1
-o3t1
-o4t2
-o5t4
-o6t4
-o7t4
-o8t5
-o9t6

espero haberme hecho entender y de antemanos muchas gracias

Última edición por rocka8613; 15/10/2010 a las 07:57