Re: A complex JOIN scenario

2006-04-11 Thread Kim Christensen
On 4/11/06, Santino <[EMAIL PROTECTED]> wrote: > I do not try it : > > select invoice_id, order_id, customer_id, invoice_timestamp, > invoice_total, null > from invoice > union all > select invoice_id, null, null, null, null, invoice_journal_id > from invoice_archive Works like a charm, thanks! -

Re: A complex JOIN scenario

2006-04-11 Thread Santino
I do not try it : select invoice_id, order_id, customer_id, invoice_timestamp, invoice_total, null from invoice union all select invoice_id, null, null, null, null, invoice_journal_id from invoice_archive Santino At 12:08 +0200 11-04-2006, Kim Christensen wrote: Hello everyone I have a pre

Re: A complex JOIN scenario

2006-04-11 Thread Kim Christensen
> If this needs to give you this result: > > > > ++--++---+-- > -+ > > | invoice_id | order_id | invoice_journal_id |invoice_timestamp | > invoice_total | > > > ++--++---+

Re: A complex JOIN scenario

2006-04-11 Thread Martijn Tonies
> > > Note that my example is not a realy result set, it's only here to show > > > you what kind of query I'm trying to build! > > > > Yes, that I understand. But WHAT is your current data in both tables > > from which you can/should derive your wanted resultset? > > invoice_archive: > +

Re: A complex JOIN scenario

2006-04-11 Thread Kim Christensen
> > Note that my example is not a realy result set, it's only here to show > > you what kind of query I'm trying to build! > > Yes, that I understand. But WHAT is your current data in both tables > from which you can/should derive your wanted resultset? invoice_archive: ++--+--

Re: A complex JOIN scenario

2006-04-11 Thread Martijn Tonies
> > > I have a pretty complex (at least for me) scenario which I really > > > can't work out the logic of. I have two tables with the following > > > layout: > > > > > > table 1: invoice > > > -- > > > invoice_id > > > order_id > > > customer_id > > > invoice_timest

Re: A complex JOIN scenario

2006-04-11 Thread Kim Christensen
On 4/11/06, Martijn Tonies <[EMAIL PROTECTED]> wrote: > Kim, > > > I have a pretty complex (at least for me) scenario which I really > > can't work out the logic of. I have two tables with the following > > layout: > > > > table 1: invoice > > -- > > invoice_id > > o

Re: A complex JOIN scenario

2006-04-11 Thread Martijn Tonies
Kim, > I have a pretty complex (at least for me) scenario which I really > can't work out the logic of. I have two tables with the following > layout: > > table 1: invoice > -- > invoice_id > order_id > customer_id > invoice_timestamp > invoice_total > ...etc (only