[sqlite] Comparing same data in two tables in two separate databases

2015-07-21 Thread Jim Callahan
yes, ATTACH and then join using a SELECT statement.

After you do the ATTACH, this video shows how to do the join using the
SQLite command line interface. Notice how you can keep track of identically
named fields in the two tables.
https://www.youtube.com/watch?v=NcrZoHselPk

Jim


On Tue, Jul 21, 2015 at 9:09 PM, Igor Tandetnik  wrote:

> On 7/21/2015 8:54 PM, Hayden Livingston wrote:
>
>> I would like to compare two tables (of the same name) in two separate
>> database files.
>>
>
> Are you looking for ATTACH DATABASE (
> http://www.sqlite.org/lang_attach.html ) ?
> --
> Igor Tandetnik
>
> ___
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>


[sqlite] Comparing same data in two tables in two separate databases

2015-07-21 Thread Igor Tandetnik
On 7/21/2015 8:54 PM, Hayden Livingston wrote:
> I would like to compare two tables (of the same name) in two separate
> database files.

Are you looking for ATTACH DATABASE ( 
http://www.sqlite.org/lang_attach.html ) ?
-- 
Igor Tandetnik



[sqlite] Comparing same data in two tables in two separate databases

2015-07-21 Thread Hayden Livingston
Hello,

I would like to compare two tables (of the same name) in two separate
database files. I could conceivably change the situation such that I
have 2 tables within the same database but different names.

My table definition is:

CREATE TABLE (SchoolId INTEGER, SchoolName TEXT, EnrollmentCount INTEGER);

I essentially want to generate a new database file that will output
the difference in EnrollmentCount for each SchoolName.

It is possible that some rows will be missing in either of the
databases, and in that case I still want to print the row.

I'm a bit new to SQLite so I don't know exactly how to syntactically
compare two databases and of course, there is the SQL of the
comparison (also which I'm new to) but I think I'll be able to figure
that part out.

I hope I've explained my question is detail. Would love your help and
suggestions.