Queries can be launched with an optional name by specifying the query.name property in the QUERY WITH block. This allows queries to be referred to by name in other commands like DESCRIBE QUERY and TERMINATE QUERY.
Query name must not conflict with the names of any other running queries within the Organization. However, it may reuse the name of a previously terminated query. Doing so will lauch the new query with the same name.
Each query is also assigned a version number. The first query to use a particular name is assigned version 1. The next query to reuse the name will get version 2 and so on.
The LIST QUERIES can be used to view the query name and version of running or terminated queries.
Arguments
query.name
This specifies the unique query name to use when launching a query.
Examples
Launch a named query
The following is an example of how to launch a Query with a name. Note the Name from LIST QUERIES is the same as the query.name.