SQL returns the SQL representation of this GROUPING SETS expression as "GROUPING SETS((a, b), (a), ())".
()
| 505 | // SQL returns the SQL representation of this GROUPING SETS expression as |
| 506 | // "GROUPING SETS((a, b), (a), ())". |
| 507 | func (g *GroupingSetsExpression) SQL() string { |
| 508 | if g == nil { |
| 509 | return "" |
| 510 | } |
| 511 | sets := make([]string, len(g.Sets)) |
| 512 | for i, set := range g.Sets { |
| 513 | sets[i] = "(" + exprListSQL(set) + ")" |
| 514 | } |
| 515 | return "GROUPING SETS(" + strings.Join(sets, ", ") + ")" |
| 516 | } |
| 517 | |
| 518 | // ============================================================ |
| 519 | // Statements |