fix ProjectionList{}.As method (issue #364)

This commit is contained in:
Yosyp Buchma 2024-07-20 16:49:49 +02:00
parent f37af464f4
commit fb66fbd31c
2 changed files with 14 additions and 3 deletions

View file

@ -45,6 +45,10 @@ func (pl ProjectionList) As(tableAlias string) ProjectionList {
newProjectionList = append(newProjectionList, p.As(tableAlias))
case ColumnExpression:
newProjectionList = append(newProjectionList, newAlias(p, tableAlias+"."+p.Name()))
case ColumnList:
for _, c := range p {
newProjectionList = append(newProjectionList, newAlias(c, tableAlias+"."+c.Name()))
}
case *alias:
newAlias := *p
_, columnName := extractTableAndColumnName(newAlias.alias)