public class GroupByScope extends AbstractScope
Visibility rules: - Can access columns from FROM scope - Cannot access aggregate functions or SELECT list aliases - In some databases (MySQL), can access SELECT list columns
Example:
SELECT department, COUNT(*) as emp_count FROM employees GROUP BY department -- Can reference employees.department
The GROUP BY scope delegates column resolution to its parent (typically a SelectScope), which has access to the FROM scope.
node, parent, scopeType| Constructor and Description |
|---|
GroupByScope(IScope parent,
TGroupBy groupByNode) |
| Modifier and Type | Method and Description |
|---|---|
IScope |
getFromScope()
Get the FROM scope.
|
TGroupBy |
getGroupByNode() |
void |
setFromScope(IScope fromScope)
Set the FROM scope for column resolution.
|
String |
toString() |
addChild, fullyQualify, getChildren, getNode, getParent, getScopeType, getVisibleNamespaces, isWithin, resolve, resolveTablepublic GroupByScope(IScope parent, TGroupBy groupByNode)
public void setFromScope(IScope fromScope)
fromScope - the FROM scopepublic IScope getFromScope()
public TGroupBy getGroupByNode()
public String toString()
toString in class AbstractScope