From 7bf408336db226b75ffefbe9920daace923c9f95 Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Wed, 30 May 2018 13:24:45 +0100 Subject: [PATCH] Allow expressions in SELECT field AS alias clauses --- sql/select.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/select.go b/sql/select.go index 32641d90..2c3e71a0 100644 --- a/sql/select.go +++ b/sql/select.go @@ -98,7 +98,7 @@ func (p *parser) parseFields() (mul Fields, err error) { if _, _, exi := p.mightBe(AS); exi { - if _, one.Alias, err = p.shouldBe(IDENT); err != nil { + if _, one.Alias, err = p.shouldBe(IDENT, EXPR); err != nil { return nil, &ParseError{Found: one.Alias, Expected: []string{"alias name"}} }