Group by clause in select statement was represented by 2 properties:
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";
You can also modify GroupbyClauseText via modifying GroupbyClause. By using GroupbyClause, you can take full control of every field involved in Group by Clause.
The key property of TLzGroupBy is GroupItems which is type of TLz_list. And items in GroupItems is type of TLzGroupByItem, so you can always cast items in GroupItems to TLzGroupByItem.
The key property of TLzGroupByItem is _ndExpr which can always been cast to TLzCustomExpression, usually, _ndExpr represents field in the group by clause.
Check BuildSelect function in this demo to find out more information:
Gudu software http://www.sqlparser.com
|
Send comments about this topic.
|