[sqlite] Results of Joins in sqlite

2014-09-23 Thread Prakash Premkumar
Hi, Let's say I have tables T1,T2 and T3 with 2 columns each and I am joining them. The result rows will have 8 columns each. Let's say an output of the join is: r11,r21,r31 r11,r21,r32 r11,r21,r33 where r1i is the i th row in T1, r2i is the i th row in T2 and r3i is the ith row in T3: sqlite

Re: [sqlite] Results of Joins in sqlite

2014-09-23 Thread Prakash Premkumar
To further clarify, the result of a join forms a row that has a new schema . (the new schema is derived from the schemas of the tables participating in the joins.) I would like to retain the old schema in the join result as well, so there is a split between which column belongs / is coming from wh

Re: [sqlite] Results of Joins in sqlite

2014-09-24 Thread Clemens Ladisch
Prakash Premkumar wrote: > Let's say I have tables T1,T2 and T3 with 2 columns each and I am joining > them. > The result rows will have 8 columns each. No. The result will have between 4 and 6 columns, depending on how you do the joins. Example: CREATE TABLE T1(ID1, Name); INSERT INTO "T1" VA

Re: [sqlite] Results of Joins in sqlite

2014-09-24 Thread Prakash Premkumar
Thanks for the reply Clemens. Yes.I'm sorry. It will not have 8 columns. When one result row comes in , I want to create an object for each table (My application map one struct to one table) and put the columns of respective tables in their individual structs. i,e I would set column 0 and column

Re: [sqlite] Results of Joins in sqlite

2014-09-24 Thread Hick Gunter
m] Gesendet: Mittwoch, 24. September 2014 09:32 An: General Discussion of SQLite Database Betreff: Re: [sqlite] Results of Joins in sqlite Thanks for the reply Clemens. Yes.I'm sorry. It will not have 8 columns. When one result row comes in , I want to create an object for each table (My app

Re: [sqlite] Results of Joins in sqlite

2014-09-24 Thread Prakash Premkumar
SELECT <...t3 fields> FROM t3 where t3.rowid=?; > > > > -Ursprüngliche Nachricht- > Von: Prakash Premkumar [mailto:prakash.p...@gmail.com] > Gesendet: Mittwoch, 24. September 2014 09:32 > An: General Discussion of SQLite Database > Betreff: Re: [sqlite] Results of Jo

Re: [sqlite] Results of Joins in sqlite

2014-09-24 Thread Simon Slavin
On 24 Sep 2014, at 11:53am, Prakash Premkumar wrote: > Thanks a lot Hick,for your approach. > With the approach you suggested, we are creating extra queries and if the > join is on n tables there will be n+1 queries , and each query will have to > go through a query planning stage. > Is there an

Re: [sqlite] Results of Joins in sqlite

2014-09-24 Thread Hick Gunter
d=?; SELECT <...t3 fields> FROM t3 where > t3.rowid=?; > > > > -Ursprüngliche Nachricht- > Von: Prakash Premkumar [mailto:prakash.p...@gmail.com] > Gesendet: Mittwoch, 24. September 2014 09:32 > An: General Discussion of SQLite Database > Betreff: Re: [sqlite] R

Re: [sqlite] Results of Joins in sqlite

2014-09-24 Thread Prakash Premkumar
rks > first? > > -Ursprüngliche Nachricht- > Von: Prakash Premkumar [mailto:prakash.p...@gmail.com] > Gesendet: Mittwoch, 24. September 2014 12:54 > An: General Discussion of SQLite Database > Betreff: Re: [sqlite] Results of Joins in sqlite > > Thanks a lot Hick

Re: [sqlite] Results of Joins in sqlite

2014-09-24 Thread Keith Medcalf
;> -Ursprüngliche Nachricht- >> Von: Prakash Premkumar [mailto:prakash.p...@gmail.com] >> Gesendet: Mittwoch, 24. September 2014 12:54 >> An: General Discussion of SQLite Database >> Betreff: Re: [sqlite] Results of Joins in sqlite >> >> Thanks a lot

Re: [sqlite] Results of Joins in sqlite

2014-09-24 Thread John Hascall
the appropriate > > > > > > SELECT <...t1 fields> FROM t1 where t1.rowid=?; SELECT <...t2 fields> > > > FROM t2 where t2.rowid=?; SELECT <...t3 fields> FROM t3 where > > > t3.rowid=?; > > > > > > > > > > > > --

Re: [sqlite] Results of Joins in sqlite

2014-09-24 Thread RSmith
On 2014/09/24 15:06, Prakash Premkumar wrote: Thanks a lot , Simon and Hick, What I am looking for is , instead of iterating through the result which sqlite provides and then form the respective objects and setting pointers, is it possible to hack sqlite to fill in the objects this way. I would

Re: [sqlite] Results of Joins in sqlite

2014-09-24 Thread dave
himself. -dave > -Original Message- > From: sqlite-users-boun...@sqlite.org > [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Keith Medcalf > Sent: Wednesday, September 24, 2014 8:27 AM > To: General Discussion of SQLite Database > Subject: Re: [sqlite] Results of Joins in

Re: [sqlite] Results of Joins in sqlite

2014-09-24 Thread James K. Lowden
On Wed, 24 Sep 2014 11:03:53 +0530 Prakash Premkumar wrote: > Let's say an output of the join is: > > r11,r21,r31 > r11,r21,r32 > r11,r21,r33 > > where r1i is the i th row in T1, r2i is the i th row in T2 and r3i is > the ith row in T3: > > sqlite produces 3 result rows , but I would like to p