12. Report-Writer Statements : Report Setup Statements : .Query Statement--Indicate Start of a Query
Share this page                  
.Query Statement--Indicate Start of a Query
The .query statement specifies an SQL or QUEL query to be used to generate data for a report. The statement syntax and description provided here apply to SQL only. If you are using the QUEL language, see .Query Statement for QUEL Users (see page .Query Statement for QUEL Users).
The .query statement has the following format:
.query |  .quer
select [all | distinct] column_list
[as resultcolumn_list]
from [schema.]table |view|synonym[corr_name]
{, table |view|synonym[corr_name]}
[where search_condition]
[group by column {, column}]
[having search_condition]
{union select_statement }
[order by ...]
For a complete explanation of the syntax and parameters for the SQL select statement within the Report-Writer .query statement, see the SQL Reference Guide.