Add GROUP BY ALL to SQL SELECT queries
This commit is contained in:
parent
30639a1ae9
commit
38f0e3469e
1 changed files with 18 additions and 0 deletions
|
@ -158,6 +158,24 @@ func (p *parser) parseGroup() (mul Groups, err error) {
|
|||
|
||||
_, _, _ = 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 {
|
||||
|
||||
var tok Token
|
||||
|
|
Loading…
Reference in a new issue