I haven\'t managed to find a way to join two *.mbtiles files together (first one contains zoom level from 0-16 and second one zoom level 17). I was working with different sqlite
If the two files have the same metadata, and if the tiles tables are actually tables and not views, you can simply append the data of one to the other table:
/* open database1 as main database, then: */
ATTACH 'database2' AS db2;
INSERT INTO tiles SELECT * FROM db2.tiles;