When you define a SQL query for a new custom report or filter, you can write a SQL query to run on the CMD. When you modify a SQL query for an existing custom report or filter, you can write a SQL query to run on the CMD. The Parameterized Query tab lets you write the SQL query that you want to run on the CMDB. This tab is primarily a free-form text box that lets you write the SQL code, or paste it from the clipboard. The Object Explorer panel lets you select source fields from the CMDB and inject them into the query. Injecting source fields simplifies the writing of the query.
You need the Edit SQL privilege to create or modify SQL queries, and you should have a good understanding of the CMDB table structure. If you want to apply scoping to the query results, you need to include the appropriate SQL code in the query.
To write an SQL query for a custom report or filter
On the Data Source tab, on the Parameterized Query tab, in the large text box, type the SQL query text.
You can type the SQL from scratch, or paste it from the clipboard.
(Optional) In the Object Explorer panel, select a database table or field to use in the query, and inject it into the SQL code.