Last active
February 24, 2020 20:46
-
-
Save jamescalam/abfe4cc4dd51ef96f0de13a1deae838c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def union(self, table_list, name="union", join="UNION"): | |
# initialise the query | |
query = "SELECT * INTO ["+name+"] FROM (\n" | |
# build the SQL query | |
query += f'\n{join}\n'.join( | |
[f'SELECT [{x}].* FROM [{x}]' for x in table_list] | |
) | |
query += ") x" # add end of query | |
self.manual(query, fast=True) # fast execute |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment