Ver Mensaje Individual
  #3 (permalink)  
Antiguo 10/02/2012, 02:44
antoninerin
 
Fecha de Ingreso: febrero-2012
Mensajes: 1
Antigüedad: 13 años
Puntos: 0
Respuesta: ejercicio SQL porfa ! no entiendo como realizarlo

Otra solución:

select COUNT(*) as '0 - 10',
(select COUNT(*) FROM tabla where Anys between 11 and 20) as '11 - 20',
(select COUNT(*) FROM tabla where Anys between 21 and 30) as '21 - 30',
(select COUNT(*) FROM tabla where Anys between 31 and 40) as '31 - 40',
(select COUNT(*) FROM tabla where Anys between 41 and 50) as '41 - 50',
(select COUNT(*) FROM tabla where Anys between 51 and 60) as '51 - 60',
(select COUNT(*) FROM tabla where Anys between 61 and 70) as '61 - 70',
(select COUNT(*) FROM tabla where Anys between 71 and 80) as '71 - 80',
(select COUNT(*) FROM tabla where Anys between 81 and 90) as '81 - 90',
(select COUNT(*) FROM tabla where Anys > 90) as 'Altres',
(select COUNT(*) FROM tabla) as 'Total'
FROM tabla
where Anys between 0 and 10