Re: [SQL] Optional join

2003-08-16 Thread Ian Barwick
On Thursday 14 August 2003 16:40, Slawek Jarosz wrote: > Hi, > > I trying to write a query that will join 2 tables. Here's the concept: > Table 1: table1, primary key pk1 > Table 2: table2, primary key pk2 > > One of the fields (f2) in table2 contains either the primary key of table1 > or a NUL

Re: [SQL] Optional join

2003-08-15 Thread David Fetter
"Slawek Jarosz" <[EMAIL PROTECTED]> wrote: > Hi, > I trying to write a query that will join 2 tables. Here's the > concept: > Table 1: table1, primary key pk1 > Table 2: table2, primary key pk2 > One of the fields (f2) in table2 contains either the primary key of > table1 or a NULL value. So

Re: [SQL] Optional join

2003-08-14 Thread Stephan Szabo
On Thu, 14 Aug 2003, Slawek Jarosz wrote: > Hi, > > I trying to write a query that will join 2 tables. Here's the concept: > Table 1: table1, primary key pk1 Table 2: table2, primary key pk2 > > One of the fields (f2) in table2 contains either the primary key of > table1 or a NULL value. So

Re: [SQL] Optional join

2003-08-14 Thread Bruno Wolff III
On Thu, Aug 14, 2003 at 10:40:02 -0400, Slawek Jarosz <[EMAIL PROTECTED]> wrote: > Hi, > > I trying to write a query that will join 2 tables. Here's the concept: > Table 1: table1, primary key pk1 > Table 2: table2, primary key pk2 > > One of the fields (f2) in table2 contains either the pr

[SQL] Optional join

2003-08-14 Thread Slawek Jarosz
Hi, I trying to write a query that will join 2 tables. Here's the concept: Table 1: table1, primary key pk1 Table 2: table2, primary key pk2 One of the fields (f2) in table2 contains either the primary key of table1 or a NULL value. So normally a pretty basic query: SELECT table1.*, table2