![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
12/02/2010, 14:16
|
![Avatar de Zeptimo](http://static.forosdelweb.com/customavatars/avatar212483_1.gif) | | | Fecha de Ingreso: enero-2008
Mensajes: 269
Antigüedad: 17 años Puntos: 1 | |
Respuesta: consulta en mysql es que me falto poner la consulta
SELECt ruta,
(case when tipobol = 1 and ruta in(2) then cantidad end) as ordinario,
(case when tipobol = 1 and ruta in(2) then monto end) as monto,
(case when tipobol = 2 and ruta in(2) then cantidad end) as preferente,
(case when tipobol = 2 and ruta in(2) then monto end) as monto,
(case when tipobol = 3 and ruta in(2) then cantidad end) as cortesias,
(case when tipobol = 3 and ruta in(2) then monto end) as monto
FROM tblconciliacion
where ruta in(2)
y el resultado es el sig:
ruta --preferente------monto------preferente-------monto-----cortesias-----monto
2-------12---------------6025
2-------++++++++++++++++++++35---------------2625
2--------++++++++++++++++++++++++++++++++++++++ 50-------10697.5
pero yo lo nescesito asi:
ruta---preferente------monto----preferente-------monto------cortesias----monto
2-------12----------------6025-------35----------------26255--------50------10697.5
saludos... |