我一直在处理以下查询,但无法将其用于 COMPUTE:
BREAK ON "Package ID" SKIP 2 on report
COMPUTE SUM OF "Package Cost" ON "Package ID"
COMPUTE SUM OF "Package Cost" ON REPORT;
Select distinct p.PkgID "Package ID", p.PkgName "Package Type", to_char(p.PkgCost, '$99.99')"Package Cost", c.CustFName || ' ' || c.CustLName as "Customer Name"
FROM Subscription s, Package p, Customer c
WHERE p.PkgID = s.PkgID
AND c.CustID = s.CustID
AND trunc (s.startdate)=to_date('Oct 01, 2012', 'Mon DD, YYYY')
ORDER BY p.PkgID;
输出如下所示:
Package ID Package Type Package Cost Customer Name
---------- --------------- ------------- ---------------------------------------------------
10101 Movies Galore $30.00 Frank Cinatra
Movies Galore $30.00 Krystal Carter
********** -------------
20202 News Globe $30.00 Billy Joel
News Globe $30.00 Dia Nelson
News Globe $30.00 Rhonda Shields
********** -------------
30303 Total Watcher $40.00 Frank McMann
Total Watcher $40.00 Orlando Magic
********** -------------
40404 Couch Potato $50.00 Allan Bubbles
********** -------------
-------------
无法计算成本。它将包裹分解得很好,甚至放在分界线上,只是没有总数。也不会贴标签。我只是错过了一些愚蠢的事情吗?