# | SERVICENAME | TOTAL | PERCENT |
---|---|---|---|
1 | COMPUTEBAREMETAL - USD 9 | 9 | 56.73 |
2 | DATABASEBAREMETAL - USD 7 | 7 | 43.27 |
#: click on a column heading to sort on it
Total for 70 days period.
Name Null? Type
----------------------------------------------------------------------------------- -------- --------------------------------------------------------
COSTS$UNITPRICE NUMBER
COSTS$OVERAGESFLAG VARCHAR2(1)
COSTS$COMPUTEDAMOUNT NUMBER
COSTS$COMPUTEDQUANTITY NUMBER
CURRENCY VARCHAR2(4)
QUANTITY NUMBER
ENDTIMEUTC VARCHAR2(32)
SERVICENAME VARCHAR2(32)
DATACENTERID VARCHAR2(16)
GSIPRODUCTID VARCHAR2(8)
RESOURCENAME VARCHAR2(64)
STARTTIMEUTC VARCHAR2(32)
SUBSCRIPTIONID VARCHAR2(8)
SUBSCRIPTIONTYPE VARCHAR2(16)
LASTCOMPUTATIONDATE VARCHAR2(32)
SERVICEENTITLEMENTID VARCHAR2(16)
WITH t1 AS (
SELECT COSTS$COMPUTEDAMOUNT COMPUTEDAMOUNT,
SERVICENAME,
CURRENCY
FROM OCI360_USAGECOSTS ),
t2 as (select sum(COMPUTEDAMOUNT) total_global from t1)
SELECT t1.SERVICENAME || ' - ' || t1.CURRENCY || ' ' || round(sum(COMPUTEDAMOUNT)) SERVICENAME,
round(sum(COMPUTEDAMOUNT)) total,
trim(to_char(round(sum(COMPUTEDAMOUNT)/decode(total_global,0,1,total_global),4)*100,'990D99')) percent
FROM t1, t2
GROUP BY t1.SERVICENAME,t1.CURRENCY,total_global
having sum(COMPUTEDAMOUNT) <> 0
order by total desc;
2 rows selected.