Add GROUP BY ALL to SQL SELECT queries

This commit is contained in:
Tobie Morgan Hitchcock 2018-10-24 12:25:07 +01:00
parent 30639a1ae9
commit 38f0e3469e

View file

@ -158,6 +158,24 @@ func (p *parser) parseGroup() (mul Groups, err error) {
_, _, _ = p.mightBe(BY) _, _, _ = p.mightBe(BY)
// If the next token is the ALL keyword then
// we will group all records together, which
// will prevent grouping by other fields.
if _, _, exi := p.mightBe(ALL); exi {
mul = append(mul, &Group{
Expr: new(All),
})
return
}
// Otherwise let's parse the fields with which
// we will group the selected data, with
// multiple fields grouped by commas.
for { for {
var tok Token var tok Token