Re: [sqlite] Comparing two tables column by column

2013-07-31 Thread ibrahim
ahoo.com> Antworten an: Fehmi Noyan ISI <fnoyan...@yahoo.com> Datum: Dienstag, 30. Juli 2013 01:54 An: Benjamin Stadin <benjamin.sta...@heidelberg-mobil.com>, General Discussion of SQLite Database <sqlite-users@sqlite.org> Betreff: Re: [sqlite] Comparing two tables column by co

Re: [sqlite] Comparing two tables column by column

2013-07-30 Thread fnoyanisi
orten an: Fehmi Noyan ISI <fnoyan...@yahoo.com> > Datum: Dienstag, 30. Juli 2013 01:54 > An: Benjamin Stadin <benjamin.sta...@heidelberg-mobil.com>, General > Discussion of SQLite Database <sqlite-users@sqlite.org> > Betreff: Re: [sqlite] Comparing two tables column

Re: [sqlite] Comparing two tables column by column

2013-07-30 Thread Stadin, Benjamin
2013 01:54 An: Benjamin Stadin <benjamin.sta...@heidelberg-mobil.com<mailto:benjamin.sta...@heidelberg-mobil.com>>, General Discussion of SQLite Database <sqlite-users@sqlite.org<mailto:sqlite-users@sqlite.org>> Betreff: Re: [sqlite] Comparing two tables column by colum

Re: [sqlite] Comparing two tables column by column

2013-07-29 Thread Fehmi Noyan ISI
__ From: "Stadin, Benjamin" <benjamin.sta...@heidelberg-mobil.com> To: Fehmi Noyan ISI <fnoyan...@yahoo.com>; General Discussion of SQLite Database <sqlite-users@sqlite.org> Sent: Tuesday, July 30, 2013 9:00 AM Subject: Re: [sqlite] Comparing two tables colu

Re: [sqlite] Comparing two tables column by column

2013-07-29 Thread Stadin, Benjamin
n of SQLite Database <sqlite-users@sqlite.org> >Sent: Monday, July 29, 2013 9:10 PM >Subject: Re: [sqlite] Comparing two tables column by column > > > >On 29 Jul 2013, at 12:36pm, Fabian Klebert ><f.kleb...@klebert-engineering.de> wrote: > >> Wouldn't >&

Re: [sqlite] Comparing two tables column by column

2013-07-29 Thread Fehmi Noyan ISI
lav...@bigfraud.org> To: General Discussion of SQLite Database <sqlite-users@sqlite.org> Sent: Monday, July 29, 2013 9:10 PM Subject: Re: [sqlite] Comparing two tables column by column On 29 Jul 2013, at 12:36pm, Fabian Klebert <f.kleb...@klebert-engineering.de> wrote: >

Re: [sqlite] Comparing two tables column by column

2013-07-29 Thread Simon Slavin
On 29 Jul 2013, at 12:36pm, Fabian Klebert wrote: > Wouldn't > > SELECT * FROM table1 > EXCEPT > SELECT * FROM table2 > > solve this problem? > I think it does for the example provided. Not sure if it would work in > real-world environment. There are two

Re: [sqlite] Comparing two tables column by column

2013-07-29 Thread Fabian Klebert
Auftrag von Stephen Chrzanowski Gesendet: Montag, 29. Juli 2013 13:01 An: General Discussion of SQLite Database Betreff: Re: [sqlite] Comparing two tables column by column To be fair to me, the example had the same column names. If the two tables have the same column names, then having a bit

Re: [sqlite] Comparing two tables column by column

2013-07-29 Thread Stephen Chrzanowski
To be fair to me, the example had the same column names. If the two tables have the same column names, then having a bit of extra code to tag on the column name + "_1" might have worked. As my first reply answered, untested. ;) On Mon, Jul 29, 2013 at 6:46 AM, Clemens Ladisch

Re: [sqlite] Comparing two tables column by column

2013-07-29 Thread Clemens Ladisch
Simon Slavin wrote: > On 29 Jul 2013, at 4:03am, Fehmi Noyan ISI wrote: >> One point I forgot to mention; the number of columns is unknown. > > There is no way in SQL to say "Give me the contents of all the columns of a > row of table in an unambiguous format.". Well, just

Re: [sqlite] Comparing two tables column by column

2013-07-29 Thread fnoyanisi
Yes, it turned out that achieving the goal with C code is much simpler than using SQL statements (I also take my limited sql knowledge into account) Now, I'll have two sqlite3_exec() calls, one of which is invoked by first call's callback function. This led having some natsy C structs around to

Re: [sqlite] Comparing two tables column by column

2013-07-29 Thread Simon Slavin
On 29 Jul 2013, at 4:03am, Fehmi Noyan ISI wrote: > One point I forgot to mention; the number of columns is unknown. There is no way in SQL to say "Give me the contents of all the columns of a row of table in an unambiguous format.". It would be possible to write the

Re: [sqlite] Comparing two tables column by column

2013-07-28 Thread Fehmi Noyan ISI
gt;; General Discussion of SQLite Database <sqlite-users@sqlite.org> Sent: Monday, July 29, 2013 12:31 PM Subject: Re: [sqlite] Comparing two tables column by column Untested select table1.col1 as Key, table1.col2 as T1C2, table1.col3 as T1C3, table1.col4 as T1C4, table2.col2 as

Re: [sqlite] Comparing two tables column by column

2013-07-28 Thread Stephen Chrzanowski
Untested select table1.col1 as Key, table1.col2 as T1C2, table1.col3 as T1C3, table1.col4 as T1C4, table2.col2 as T2C2, table2.col3 as T2C3, table2.col4 as T2C4 from Table1 join Table2 on Table1.Col1=Table2.Col2 order by table1.col1 On Sun, Jul 28, 2013 at 10:44 PM, Fehmi Noyan ISI

[sqlite] Comparing two tables column by column

2013-07-28 Thread Fehmi Noyan ISI
Hi, I would like to compare two tables row by row having same primary keys. The comparison should take each row from TABLE1 and find relevant entry (based on KEY) from TABLE2 and compare value of EACH column. For the TABLE1 and TABLE2 below, the values of COL4 for KEY3 should be returned

Re: [sqlite] Comparing two tables?

2009-09-30 Thread Simon Slavin
On 30 Sep 2009, at 10:48pm, Petite Abeille wrote: > On Sep 30, 2009, at 11:41 PM, Simon Slavin wrote: > >> It would be technically possible to write some clever SQL to do it >> all >> in one operation. > > Why the "clever" characterization? It's more SQL than most people bother to learn.

Re: [sqlite] Comparing two tables?

2009-09-30 Thread Petite Abeille
On Sep 30, 2009, at 11:41 PM, Simon Slavin wrote: > It would be technically possible to write some clever SQL to do it all > in one operation. Why the "clever" characterization? > But it would be complicated to debug and ... well, > do you really want to waste the time getting it right ?

Re: [sqlite] Comparing two tables?

2009-09-30 Thread Simon Slavin
On 30 Sep 2009, at 9:55pm, Joe Bennett wrote: > Find the first row of data in TableB, take Column1 and Column2's data > from row one and see if that data exists in TableA. Something like > this: SELECT * FROM TableA WHERE Column1=Row1Data AND > Column2=Row1Data. That's a JOIN. There are lots

Re: [sqlite] Comparing two tables?

2009-09-30 Thread Petite Abeille
On Sep 30, 2009, at 10:55 PM, Joe Bennett wrote: > I'm not sure I'm far enough along with sqlite to maybe get what ya'll > are telling me... Right... with SQL it helps to thing in terms of set operations instead of procedural code... here is an illustration to get you started: "A Visual

Re: [sqlite] Comparing two tables?

2009-09-30 Thread Rich Shepard
On Wed, 30 Sep 2009, Joe Bennett wrote: > Have two tables that have the same columns, but different number of rows > (rows do not match but columns do. 86 matching columns in each table): That's to be expected; why would the rows match? > Now, I'm looking to do this: > > Find the first row

Re: [sqlite] Comparing two tables?

2009-09-30 Thread Joe Bennett
I'm not sure I'm far enough along with sqlite to maybe get what ya'll are telling me... I'll try explaining it this way... Have two tables that have the same columns, but different number of rows (rows do not match but columns do. 86 matching columns in each table): TableA: Column1Column 2

Re: [sqlite] Comparing two tables?

2009-09-29 Thread Petite Abeille
On Sep 29, 2009, at 6:50 PM, Cory Nelson wrote: > i believe he means except, not minus. Correct. Got my SQL dialects intermingled :) > If all you need is differing > rows, this will work like a charm. Otherwise if you need a more > fine-grained delta like only returning columns that changed,

Re: [sqlite] Comparing two tables?

2009-09-29 Thread Cory Nelson
On Tue, Sep 29, 2009 at 9:38 AM, Petite Abeille wrote: > > On Sep 29, 2009, at 6:32 PM, Joe Bennett wrote: > >> Have two tables structured exactly the same. Want to compare both of >> them and get the delta. Been Googling for about an hour now and I see >> tools that do

Re: [sqlite] Comparing two tables?

2009-09-29 Thread Adam DeVita
Good day, Are you looking to simply identify records that are different (not missing from the tables) or identify records with ANY field different and get the result? Is there a primary key? Posting the structure would be helpful. This should not be hard. C:\Documents and

Re: [sqlite] Comparing two tables?

2009-09-29 Thread Joe Bennett
Figuratively I'm looking to take a row in table A, find it in table B and compare the values in each column... If there is a delta, let me know What I am trying to do is take an old table and compare it to the new one and show the changes... -Joe On Tue, Sep 29, 2009 at 12:37 PM,

Re: [sqlite] Comparing two tables?

2009-09-29 Thread bartsmissaert
What is the delta? RBS > Hi, > > > Have two tables structured exactly the same. Want to compare both of > them and get the delta. Been Googling for about an hour now and I see > tools that do this (maybe a freeware one I haven't found?) and was > looking for a solution that more meets the

[sqlite] Comparing two tables?

2009-09-29 Thread Joe Bennett
Hi, Have two tables structured exactly the same. Want to compare both of them and get the delta. Been Googling for about an hour now and I see tools that do this (maybe a freeware one I haven't found?) and was looking for a solution that more meets the budget I was given for this project,

Re: [sqlite] Comparing two tables?

2009-09-29 Thread Petite Abeille
On Sep 29, 2009, at 6:32 PM, Joe Bennett wrote: > Have two tables structured exactly the same. Want to compare both of > them and get the delta. Been Googling for about an hour now and I see > tools that do this (maybe a freeware one I haven't found?) and was > looking for a solution that more