--------------------------------------------------------
--  DDL for View OCI_COST_AND_USAGE_COMPUTE_CAPACITY_RESERVATION_VW
--------------------------------------------------------

  CREATE OR REPLACE FORCE EDITIONABLE VIEW "OTHQ_OWN"."OCI_COST_AND_USAGE_COMPUTE_CAPACITY_RESERVATION_VW" ("RESOURCEID", "X_COMPARTMENTNAME", "X_ATTRIBUTEDCOST") DEFAULT COLLATION "USING_NLS_COMP"  AS 
  SELECT
  resourceid,
  x_compartmentname,
  SUM(x_attributedcost) AS x_attributedcost
FROM archive_oci_cost_and_usage_daily_tb
WHERE resourcetype = 'capacityreservation'
  AND x_compartmentname IN ('NetSuite.Production', 'NetSuite.QA')
  AND chargeperiodstart >= TRUNC(SYSDATE) - 30
GROUP BY
  resourceid,
  x_compartmentname
;


