Facebook
From Colorant Cat, 8 Years ago, written in Oracle 9.2 PL/SQL.
This paste is a reply to Re: Re: Re: Re: Untitled from Blush Lion - go back
Embed
Viewing differences between Re: Re: Re: Re: Untitled and Re: Re: Re: Re: Re: Untitled
SELECT k.nazwa, d.czasdostawy, d.towar 
t. kod, t.nazwa, 
ROUND((((avg(o.rozchodwartosc)-avg(o.przychodwartosc))/avg(o.rozchodwartosc))*100),2) 
AS "MARZA [%]",
ROUND((((avg(o.rozchodwartosc)-avg(o.przychodwartosc))/avg(o.przychodwartosc))*100),2) 
AS "NARZUT [%]"
FROM KONTRAHENCI k obroty o JOIN DOSTAWCYTOWARU d towary t 
ON k.id=d.kontrahenci_id
WHERE d.towar=2;
o.TOWAR=t.id
GROUP BY t.kod, t.nazwa;