Advertisement
AbraaoAllysson

questao-15

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