Organizing Queries Using Custom Query Groups

Organizing Queries Using Custom Query Groups

Overview

Query Groups allow you to organize the Queries you have created and customized into easily retrievable groups. These files can be placed on a network drive and shared with other project members to promote SQL statement reuse and avoid wasted time re-creating SQL statements. 

Sample Query Groups

Andi includes a sample Query Group with the sample University database that will help get you started interacting with Query Groups. You can access Custom Queries by selecting the Tools Menu, then selecting Custom Queries: 

image-20250905-160650.png

Once Custom Queries is selected from the Tools menu, the Custom Query Groups window will appear. By selecting the Query Group menu list, users can select from existing sample / created / shared Query Groups: 

This will display the Custom Queries that exist within the Group:

image-20250905-160714.png
image-20250905-160726.png

Create a Custom Query Group

To create a new Custom Query Group, select the green '+' icon and select a folder and filename for the new file. If you do not add a file extension, the default extension ".cqg" will be used. 

image-20250905-160738.png

Add a Custom Query to a Custom Query Group

Once a Custom Query Group has been created, you can begin adding Custom Queries. 

Be sure to type in a clear description for the Description field - this will help other users who might be less knowledgeable with SQL to understand clearly what the SQL will do when run! Then, type or copy the SQL into the Custom Query box: 

image-20250905-160748.png

Select the Add button to add your Description and Custom Query SQL to the Custom Query Group: 

image-20250905-160801.png

The new Custom Query will appear as an option to select from in the Query Group: 

image-20250905-160812.png

Run a Saved Custom Query

Users have the ability to run saved Custom Queries by simply selecting a saved Query, and then selecting Run. This will automatically enter the SQL into the Query Editor and produce the Query result set: 

image-20250905-160829.png
image-20250905-160842.png

Delete a Query Group or Custom Query

To delete a Query Group entirely, select the trash bin icon in the upper right hand corner: 

image-20250905-160857.png

Note: The option to Remove or Delete the Query Group is available. By selecting Remove, the Query Group will no longer be available from the Query Group menu, but will remain on the file system.

To delete a single Custom Query from a Custom Query Group, select the desired Custom Query and select Delete: 

image-20250905-160911.png