Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT pr.nome,ip.total, SUM(pe.total) as Total_Pedido, ( (ip.total*100)/pe.total) as Porcetagem_Total
- from itenspedido ip, pedido pe, produto pr
- where ip.produto = pr.id_produto
- and ip.pedido = pe.id_pedido
- and DATE_PART('YEAR',pe.data_pedido)=2015
- GROUP BY pr.nome,ip.total,pe.total ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement