Advertisement
Guest User

Untitled

a guest
Jul 15th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. select `bd_puntoventa`.`tb_producto`.`NombreProducto` AS `NombreProducto`,(case month(`bd_puntoventa`.`tb_venta`.`FechaVenta`) when 1 then 'enero' when 2 then 'febrero' when 3 then 'marzo' when 4 then 'abril' when 5 then 'mayo' when 6 then 'junio' when 7 then 'julio' when 8 then 'agosto' when 9 then 'septiembre' when 10 then 'octubre' when 11 then 'noviembre' when 12 then 'diciembre' else 'null' end) AS `mes`,sum(`bd_puntoventa`.`tb_venta`.`Cantidad`) AS `CporM` from (`bd_puntoventa`.`tb_venta` join `bd_puntoventa`.`tb_producto` on((`bd_puntoventa`.`tb_venta`.`idProducto` = `bd_puntoventa`.`tb_producto`.`idProducto`))) group by tb_venta.FechaVenta order by sum(`bd_puntoventa`.`tb_venta`.`Cantidad`) desc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement