code: def split_subquery(sql):
      
      sql, params = mark_quoted_strings(sql)
      sql = simplify_expression(sql)
      _ = params  # NOQA
      start = 0
      out = []
      subqueries = []
      pattern = re.compile(r'\(SELECT\b', re.I)
      match = pattern.search(sql, start)
      while match:
          out.append(sql[start:match.start() + 1] + '&')
          start, pos = find_closing_parenthesis(sql, match.start())
          start, pos = start + 1, pos - 1
          subqueries.append(split_subquery(sql[start:pos]))
          start = pos
          match = pattern.search(sql, start)
      out.append(sql[start:len(sql)])
      return ''.join(out), subqueries
docs: Split on subqueries and replace them by '&'.