insert into combinedTable select * from table1 union select * from table2 union select * from table 3;
{set} union {set} returns the distinct result {set} union all {set} returns a results that may have duplicate rows > -----Original Message----- > From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users- > bounces at mailinglists.sqlite.org] On Behalf Of Igor Tandetnik > Sent: Wednesday, 11 November, 2015 07:32 > To: sqlite-users at mailinglists.sqlite.org > Subject: Re: [sqlite] combining overlapping tables > > On 11/11/2015 3:56 AM, J.L. Blom wrote: > > So e.g. table one ends (in column one) on 2015-07-21 11:55 > > and the next starts on 2015-07-19 > > 17:50 > > There is an overlap op 2 days approx. 380 rows (each row contains 53 > > items). > > Is there a script - or commando to combine the tables excluding the > > overlapping rows? > > Are you looking for something like > > insert into TableOne > select * from TableTwo t2 > where t2.timestamp > (select max(timestamp) from TableOne); > > -- > Igor Tandetnik > > _______________________________________________ > sqlite-users mailing list > sqlite-users at mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users