OK. I made a mistake. UNION of multiple tables should work.

On Fri, Sep 6, 2019 at 7:28 PM Peng Yu <pengyu...@gmail.com> wrote:
>
> Hi, I think that there is no way to UNION 3 tables in one command is
> it. What is the best way to merge 3 and more sqlar files? Thanks.
>
> On Fri, Sep 6, 2019 at 6:30 PM Keith Medcalf <kmedc...@dessus.com> wrote:
> >
> >
> > UNION is for "unioning" the output of two select statements (with duplicate 
> > rows removed).  It does not matter if the tables are in the same database 
> > or even on the same planet, as long as they can be accessed on the same 
> > connection.  Sqlar creates nothing more than a standard sqlite database 
> > file with a table called sqlar that contains the data.
> >
> > >sqlite
> > SQLite version 3.30.0 2019-09-04 07:55:38
> > Enter ".help" for usage hints.
> > Connected to a transient in-memory database.
> > Use ".open FILENAME" to reopen on a persistent database.
> > sqlite> .ar -cf test.db appi.py
> > sqlite> .ar -cf test1.db bs.py
> > sqlite> attach 'test.db' as test;
> > sqlite> attach 'test1.db' as test1;
> > sqlite> create table sqlar as select * from test.sqlar union select * from 
> > test1.sqlar;
> > sqlite> .ar -t
> > appi.py
> > bs.py
> >
> > --
> > The fact that there's a Highway to Hell but only a Stairway to Heaven says 
> > a lot about anticipated traffic volume.
> >
> > >-----Original Message-----
> > >From: sqlite-users <sqlite-users-boun...@mailinglists.sqlite.org> On Behalf
> > >Of Peng Yu
> > >Sent: Friday, 6 September, 2019 17:04
> > >To: SQLite mailing list <sqlite-users@mailinglists.sqlite.org>
> > >Subject: [sqlite] Merge two sqlar files
> > >
> > >Hi,
> > >
> > >UNION is for tables in the same db file. Is there an easy command to
> > >combine two sqlar files? Thanks.
> > >
> > >https://www.sqlitetutorial.net/sqlite-union/
> > >
> > >--
> > >Regards,
> > >Peng
> > >_______________________________________________
> > >sqlite-users mailing list
> > >sqlite-users@mailinglists.sqlite.org
> > >http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
> >
> >
> >
> > _______________________________________________
> > sqlite-users mailing list
> > sqlite-users@mailinglists.sqlite.org
> > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
>
>
> --
> Regards,
> Peng



-- 
Regards,
Peng
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to