Select Statement
The select_statement node represents a SQL SELECT query. It is the top-level node for data retrieval operations.
Structure
| <xs:element name="select_statement">
<xs:complexType>
<xs:sequence>
<xs:element name="cte_list" type="cte_list_type" minOccurs="0"/>
<xs:element name="query_expression" type="query_expression_type"/>
</xs:sequence>
</xs:complexType>
</xs:element>
|
Elements
| Element |
Type |
Description |
cte_list |
cte_list_type |
Represents a Common Table Expression (CTE) defined using the WITH clause. Optional. |
query_expression |
query_expression_type |
The main body of the query. Required. |
Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 | <statement type="select_statement">
<query_expression>
<query_specification>
<select_list>
<result_column>
<expression expr_type="column_referenced_expr">
<objectName>
<full_name>*</full_name>
</objectName>
</expression>
</result_column>
</select_list>
<from_clause>
<table_reference type="named_table_reference">
<named_table_reference>
<table_name>
<full_name>employees</full_name>
<object_name>employees</object_name>
</table_name>
</named_table_reference>
</table_reference>
</from_clause>
</query_specification>
</query_expression>
</statement>
|