Ver Mensaje Individual
  #4  
Antiguo 02-05-2011
urixiv urixiv is offline
Miembro
 
Registrado: sep 2006
Posts: 23
Reputación: 0
urixiv Va por buen camino
hola,
no se si lo he entendido bien, pero te digo como yo lo haria, prueba si quieres y nos comentas
Código SQL [-]
select 
   (select count(*) from b_reviews where rating = 0) as Rating0,
   (select count(*) from b_reviews where rating = 1) as Rating1,
   (select count(*) from b_reviews where rating = 2) as Rating2,
   (select count(*) from b_reviews where rating = 3) as Rating3,
   (select count(*) from b_reviews where rating = 4) as Rating4,
   (select count(*) from b_reviews where rating = 5) as Rating5

Creo que esto te daría lo que quieres, igual no es la consulta más eficiente del mundo pero te puede valer!!!

Espero haberte ayudado!
Responder Con Cita