Ver Mensaje Individual
  #2 (permalink)  
Antiguo 28/11/2011, 13:50
Avatar de Libras
Libras
Colaborador
 
Fecha de Ingreso: agosto-2006
Ubicación: En la hermosa perla de occidente
Mensajes: 7.412
Antigüedad: 17 años, 9 meses
Puntos: 774
Respuesta: ejercicio SQL porfa ! no entiendo como realizarlo

select
case when edad >=18 and edad <=30 then count(1) end as tramo1,
case when edad >=31 and edad <=40 then count(1) end as tramo2
...
from
(
select (2011 - datepart(year,fecha_nac)) AS edad
) t1


Saludos!
__________________
What does an execution plan say to t-sql query? Go f**k yourself, if you are not happy with me