On 24-09-10 21:06, Rich Shepard wrote:
> On Fri, 24 Sep 2010, John Reed wrote:
>
>> I compare an application every few days which has sqlite as it's client
>> database. I look at the content and check whether documents have made it
>> into the application after it has been built. I also check the metadata in
>> the sqlite client database for changes. So, I am constantly comparing the
>> last database with the newer database. Both databases have exactly the
>> same tables, with only the data being changed in most of the 51 tables.The
>> largest table has about 3,700,000 rows. Most other tables have much less
>> rows in them. Could someone suggest an sql query to find the difference in
>> the same table (ta) for both the last database (db1) and the newer
>> database (db2)? I can use SQLiteSpy to connect and attach to the
>> databases.
>     You'll want to tune the syntax, but try something like:
>
>     SELECT colA FROM db1 WHERE (NOT EXIST colA IN db2);
>
> The idea is to match rows in each table and where the equivalent row in db1
> is not in db2, add that to the results table.
>
> Rich
you mean something like:
select  id1, id2 from callprog a where id1 not in (select b.id1 FROM 
callprog b where b.id1=a.id1 );

But what is there is more than 1 column?
it will grow in complexity when you have a lot of columns.....

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to