You are here: Using General SQL Parser > Select Statement
ContentsIndexHome
PreviousUpNext
Select Statement

Select statement includes following topics, any un-documented clauses in select statement will be added later.

Topics
Topic 
Description 
From clause in select statement was represented by JoinTables which is type of TLzJoinList.
For more detailed information about join table in from clause, you can check "how to use join table".
JoinTables represents from clause in a hierarchy structure which includes all information in from clause such as join table, join type and join condition, if you only need to fetch table information in from clause, you can use tables instead which is type of TLzTableList.

Here are some key properties of TLzTable:

  1. TableName, fetch table name or set table name to new value by... more 
Select list in select statement was represented by Fields which is type of TLzFieldList.
You can use SelectClauseText to fetch or set whole string value of select list, or iterate
Fields to handle each field separately.

Here are some key properties of TLzField:

FieldType which is type of TLzFieldType
  • lftColumn: it represents a column information in create table statement. and following properties are valid only FieldType is lftColumn
    1. ColumnName
    2. ComputedColumnExpr
    3. FieldDataType
    4. ColumnConstraints
  • lftAttr, check FieldAttr for field information
  • lftExpression, field is an expression, check FieldExpr for detailed information.
  • lftSubquery, field is a subquery, check subquery for more.

You... more 
Where clause in select statement was represented by 2 properties:
  1. WhereClauseText, this is the string representation, you can fetch or set where clause directly by using this property.
  2. WhereClause, which is type of TLzCustomExpression, this property includes detailed information about where clause. Please check "How to use expression" for more.


You can check following demos shipped together with this component to find out more information about how to work with expression
  1. visitexpression
 
Group by clause in select statement was represented by 2 properties:
  1. GroupbyClauseText,this is the string representation, you can fetch or set group by clause directly by using this property.

Text in GroupbyClauseText includes group by keyword, so if you fetch value from GroupbyClauseText, you can see something like this: group by f1,f2, but not value like this: f1,f2.
If you want to append new field value, then do something like this:
GroupbyClauseText = GroupbyClauseText + ",f3"

Or set new value of GroupbyClauseText,
GroupbyClauseText = "group by f3";
  1. GroupbyClause, which is type of TLzGroupBy,and represents detailed information about group by clause.... more 
Having clause in select statement was represented by 2 properties:
  1. HavingClauseText, this is the string representation, you can fetch or set having clause directly by using this property.
  2. HavingClause, which is type of TLzCustomExpression, this property includes detailed information about having clause. Please check "How to use expression" for more.

You can check following demos shipped together with this component to find out more information about how to work with expression
  1. visitexpression
 
Order by clause in select statement was represented by 2 properties:
  1. SortClauseText, this is the string representation, you can fetch or set order by clause directly by using this property.
  2. SortClause, which is type of TLzOrderbyList, and represents detailed information about order by clause.
Items in TLzOrderbyList is type of TLzOrderBy which represents each field in order by list.
there are 2 kinds of field that can be represents by TLzOrderBy, use SortItemType which is type of TLzSortItemType to determine type of field.
  • sitExpression, use SortExpr which is type of TLzCustomExpression to represent field.
  • sitSubquery, use sortSubquery which is type... more 
Gudu software http://www.sqlparser.com
Send comments about this topic.