Re: [sqlite] Comparing two tables column by column

2013-07-31 Thread ibrahim
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 column The approach I am using to compare tableA_old

Re: [sqlite] Comparing two tables column by column

2013-07-30 Thread Stadin, Benjamin
benjamin.sta...@heidelberg-mobil.commailto:benjamin.sta...@heidelberg-mobil.com, General Discussion of SQLite Database sqlite-users@sqlite.orgmailto:sqlite-users@sqlite.org Betreff: Re: [sqlite] Comparing two tables column by column The approach I am using to compare tableA_old and tableA_new

Re: [sqlite] Comparing two tables column by column

2013-07-30 Thread fnoyanisi
, 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 column The approach I am using to compare tableA_old and tableA_new is; typedef struct container_t

Re: [sqlite] Comparing two tables column by column

2013-07-29 Thread Simon Slavin
On 29 Jul 2013, at 4:03am, Fehmi Noyan ISI fnoyan...@yahoo.com 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 code you

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 Clemens Ladisch
Simon Slavin wrote: On 29 Jul 2013, at 4:03am, Fehmi Noyan ISI fnoyan...@yahoo.com 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 give me

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 clem...@ladisch.de

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 Simon Slavin
On 29 Jul 2013, at 12:36pm, Fabian Klebert f.kleb...@klebert-engineering.de 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 elements:

Re: [sqlite] Comparing two tables column by column

2013-07-29 Thread Fehmi Noyan ISI
...@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: Wouldn't SELECT * FROM table1

Re: [sqlite] Comparing two tables column by column

2013-07-29 Thread Stadin, Benjamin
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 SELECT * FROM table1 EXCEPT SELECT * FROM table2 solve this problem? I think it does for the example provided. Not sure

Re: [sqlite] Comparing two tables column by column

2013-07-29 Thread Fehmi Noyan ISI
: 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 column by column If you like ruby, I have another idea to get

[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 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

Re: [sqlite] Comparing two tables column by column

2013-07-28 Thread Fehmi Noyan ISI
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 T2C2, table2.col3 as T2C3