Common use cases of data query
Here are examples of common data query use cases, including retrieving account details, processed usage records, and product information.
Query examples
-
For customer account A00000977, retrieve:
- The account number
- The account name
- The account status
- The username of the Zuora user who created the account
-
Retrieve all processed usage records, including the account number and account name associated with each usage record:
-
Retrieve the parent account number of each customer account:
-
Retrieve all Order MRR metrics and Order TCB metrics:
-
Retrieve the 3 products that became effective most recently:
-
Retrieve the 3 products that became effective most recently and are still effective:
-
Retrieve the rate plans in a product, using a 32-character product identifier:
-
Retrieve the 32-character identifiers of the rate plans in a product:
-
Retrieve the number of subscriptions owned by each customer account:
-
Retrieve the yearly average invoice amount for an account:
-
Retrieve invoices from a bill run that did not successfully generate a PDF. Check those with a status of Pending, Processing, or Error.
-
Retrieve the current status of PDF generation requests for invoices from a bill run:
-
Retrieve all records in a Custom Object named Vehicle:
ZOQL to SQL conversions
See the following examples of converting ZOQL queries to SQL queries.
-
Retrieve Account, Subscription, and Product information from RatePlanCharge
-
Retrieve Account, Subscription, and Product Information from Invoice
-
Retrieve all active Subscriptions with no Rate Plan