SQL returns the SQL representation of this set operation as "left UNION|EXCEPT|INTERSECT [ALL] right".
()
| 952 | // SQL returns the SQL representation of this set operation as |
| 953 | // "left UNION|EXCEPT|INTERSECT [ALL] right". |
| 954 | func (s *SetOperation) SQL() string { |
| 955 | if s == nil { |
| 956 | return "" |
| 957 | } |
| 958 | left := stmtSQL(s.Left) |
| 959 | right := stmtSQL(s.Right) |
| 960 | op := s.Operator |
| 961 | if s.All { |
| 962 | op += " ALL" |
| 963 | } |
| 964 | return fmt.Sprintf("%s %s %s", left, op, right) |
| 965 | } |
| 966 | |
| 967 | // SQL returns the SQL representation of this VALUES clause as |
| 968 | // "VALUES (v1, v2), (v3, v4), ...". |