def to_outer_join_sql(self, orig_where = []):
if not self.group:<EOL><INDENT>return str(self)<EOL><DEDENT>select = str(self.select)<EOL>fr = '<STR_LIT:U+002C>'.join(self.fr)<EOL>filter_q = "<STR_LIT>" % fr<EOL>if self.where:<EOL><INDENT>filter_q += "<STR_LIT>" % self.wherestr<EOL><DEDENT>select_clause = self.select.coalesced_str()<EOL>groupby = '<STR_LIT:U+002C>'.join(list(self.group))<EOL>if self.order:<EOL><INDENT>orderby = '<STR_LIT:U+002C>'.join(list(self.order))<EOL><DEDENT>else:<EOL><INDENT>orderby = groupby<EOL><DEDENT>if orig_where:<EOL><INDENT>orig_where = self.__wherestr__(orig_where)<EOL>orig_where = '<STR_LIT>' % orig_where<EOL><DEDENT>else:<EOL><INDENT>orig_where = '<STR_LIT>'<EOL><DEDENT>sql = """<STR_LIT>""" % (filter_q, select_clause, groupby, fr, orig_where, groupby, groupby, orderby)<EOL>print(sql)<EOL>return sql<EOL>
Construct a SQL query that includes all groups that would have
existed (exists in the orig_where clause) if the WHERE clause were not present