LIST SAVED QUERIES
LIST_SAVED_QUERIES
lists the available previously saved queries.
This is an alternative way to using the savedqueries
catalog view.
Read more in the Saved Queries guide.
See also: SAVE QUERY, EXECUTE SAVED QUERY, DROP SAVED QUERY, SHOW SAVED QUERY
Syntax
list_saved_queries_statement ::=
SELECT LIST_SAVED_QUERIES()
Returns
A list of saved queries the user has SELECT
permissions on.
Parameters
None
Notes
This statement returns an empty result set if no saved queries exist in the current database.
Examples
Listing previously saved queries
SELECT LIST_SAVED_QUERIES();
saved_query
-------------------------
select_all
select_by_weight
select_by_weight_and_team
SELECT SHOW_SAVED_QUERY('select_by_weight_and_team');
saved_query
-----------------------------------------------
SELECT * FROM nba WHERE Weight > ? AND Team = ?
Listing saved queries with the catalog
Using the catalog is also possible:
SELECT * FROM sqream_catalog.savedqueries;
name | num_parameters
--------------------------+---------------
select_all | 0
select_by_weight | 1
select_by_weight_and_team | 2
Permissions
Listing saved queries requires no special permissions.