Re: [sqlite] LEFT OUTER JOIN + INNER JOIN problem

2006-11-14 Thread drh
=?UTF-8?B?R8OhYm9yIEZhcmthcw==?= [EMAIL PROTECTED] wrote: select * from role LEFT OUTER JOIN person_role on role.id = person_role.role_id INNER JOIN person on person_role.person_id = person.id WHERE person.id=1; 5|admin|1|5|1|john 6|devel i think it should only output the first

[sqlite] LEFT OUTER JOIN + INNER JOIN problem

2006-11-14 Thread Gábor Farkas
hi, consider the following sql: CREATE TABLE person ( id integer, name varchar ); CREATE TABLE role ( id integer, name varchar ); CREATE TABLE person_role ( person_id integer, role_id integer, UNIQUE (person_id, role_id) ); insert into person values (1,'john');

Re: [sqlite] LEFT OUTER JOIN + INNER JOIN problem

2006-11-14 Thread Mario Frasca
Gábor Farkas wrote: i think it should only output the first row ( 5|admin|1|5|1|john ) tried what you describe and get the answer you expect, not the one you got: sqlite select * from role ... LEFT OUTER JOIN person_role on role.id = person_role.role_id ... INNER JOIN person on

RE: [sqlite] LEFT OUTER JOIN + INNER JOIN problem

2006-11-14 Thread RB Smissaert
this SQLite! RBS -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 14 November 2006 12:41 To: sqlite-users@sqlite.org Subject: Re: [sqlite] LEFT OUTER JOIN + INNER JOIN problem =?UTF-8?B?R8OhYm9yIEZhcmthcw==?= [EMAIL PROTECTED] wrote: select * from role LEFT OUTER

Re: [sqlite] LEFT OUTER JOIN + INNER JOIN problem

2006-11-14 Thread Kees Nuyt
On Tue, 14 Nov 2006 13:17:17 +0100, you wrote: Gábor Farkas wrote: i think it should only output the first row ( 5|admin|1|5|1|john ) tried what you describe and get the answer you expect, not the one you got: [...] using debian 3.1, sqlite3 3.3.8, the same also on Mac OS X, sqlite3 3.3.7...

Re: [sqlite] LEFT OUTER JOIN + INNER JOIN problem

2006-11-14 Thread drh
[EMAIL PROTECTED] wrote: =?UTF-8?B?R8OhYm9yIEZhcmthcw==?= [EMAIL PROTECTED] wrote: select * from role LEFT OUTER JOIN person_role on role.id = person_role.role_id INNER JOIN person on person_role.person_id = person.id Your work-around is to say CROSS JOIN here instead of INNER JOIN.

Re: [sqlite] LEFT OUTER JOIN + INNER JOIN problem

2006-11-14 Thread gabor
[EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: =?UTF-8?B?R8OhYm9yIEZhcmthcw==?= [EMAIL PROTECTED] wrote: select * from role LEFT OUTER JOIN person_role on role.id = person_role.role_id INNER JOIN person on person_role.person_id = person.id Your work-around is to say CROSS JOIN here