[OCI DWH][MySQL] Services on ONTAP/7-Mode Qtrees with Count and Quota Used

SELECT

  a.name AS 'Service',

  count(*) AS 'Qtree Count',

  sum(quotaUsedCapacityMB)/1024 AS 'Sum of Quota Used GB'

FROM qtree AS q

JOIN qtree_to_application AS qa ON qa.qtreeId = q.id

JOIN application AS a ON a.id = qa.applicationId

JOIN storage AS s ON s.id = q.storageId

WHERE s.microcodeVerison LIKE '%ONTAP'

OR s.microcodeVersion LIKE '%7-Mode'

GROUP BY a.id;

Comments