Customers / Orders
select c.custno, c.company, sum(itemstotal) summ
from customer c join orders o on o.custno=c.custno
group by 1,2
order by company
select o.orderno, cast(saledate as date) saledate, cast(shipdate as date) shipdate,
paymentmethod, itemstotal, amountpaid, e.lastname
from orders o
join employee e on e.empno=o.empno
where custno=:custno {{manager}}
order by 1
{{{_text}}}
{{{detail}}}
select extract(year from saledate) ayear, sum(itemstotal) summ
from orders where custno={{CUSTNO}} group by 1
]]>