title: How to Merge Multiple Database files in SQLite?
body: <p>I have multiple database files which exist in multiple locations with exactly similar structure. I understand the attach function can be used to connect multiple files to one database connection, however, this treats them as seperate databases. I want to do something like:</p>
  
  <pre><code>SELECT uid, name FROM ALL_DATABASES.Users;
  </code></pre>
  
  <p>Also, </p>
  
  <pre><code>SELECT uid, name FROM DB1.Users UNION SELECT uid, name FROM DB2.Users ;
  </code></pre>
  
  <p>is NOT a valid answer because I have an arbitrary number of database files that I need to merge. Lastly, the database files, must stay seperate. anyone know how to accomplish this?</p>
  
  <p>EDIT: an answer gave me the idea: would it be possible to create a view which is a combination of all the different tables? Is it possible to query for all database files and which databases they 'mount' and then use that inside the view query to create the 'master table'?</p>