
06/01/2008, 14:33
|
| | Fecha de Ingreso: enero-2008
Mensajes: 6
Antigüedad: 17 años, 1 mes Puntos: 0 | |
Re: como obtener diferencias en acumulados yo he realizado la siguiente consulta:
select week(dia_planing,3) as semana,
case when week(dia_planing,3)=(select (week(dia_planing,3)) from reservas order by dia_planing) then numero_reservas
else (numero_reservas-(select numero_reservas from reservas as reservasanteriores where week(dia_planing,3)=(week(dia_planing,3)-1))) end as unidades
from reservas order by dia_planing
esto consulta me da subquery returns more than 1 row |