List:General Discussion« Previous MessageNext Message »
From:Kim Christensen Date:April 11 2006 10:46am
Subject:Re: A complex JOIN scenario
View as plain text  
> If this needs to give you this result:
>
> >
> +------------+----------+--------------------+-------------------+----------
> -----+
> > | invoice_id | order_id | invoice_journal_id |invoice_timestamp |
> invoice_total |
> >
> +------------+----------+--------------------+-------------------+----------
> -----+
> > |       1062 |     1035 |                  6 | NULL | NULL | NULL |
> > |       1063 |     1036 |                  6 |..more NULL ...
> > |       1064 |     1037 |                  8 |
> > |       1065 |     1038 |          NULL| 1144744655        | 777
> |
>
> then a UNION is the only thing you can do. It's not a JOIN at all. Oh wait,
> you can call it a FULL JOIN, which simply returns results from both tables
> in the join, but hey, that's actually the "lack of a join", IMO :-)

Yeah, I guess a FULL one is exactly what I think I'm looking for.
Still can't work the query out though, since both columns have
different column lengths MySQL is complaining - I need to know how to
NULL the non-existant table columns for the rows that doesn't have any
values for them.

Any hints? ;-)

--
Kim Christensen
kim.christensen@stripped
Thread
A complex JOIN scenarioKim Christensen11 Apr
  • Re: A complex JOIN scenarioMartijn Tonies11 Apr
    • Re: A complex JOIN scenarioKim Christensen11 Apr
  • Re: A complex JOIN scenarioMartijn Tonies11 Apr
    • Re: A complex JOIN scenarioKim Christensen11 Apr
  • Index merge optimization (with OR) and table joinsStuart Brooks11 Apr
    • Re: Index merge optimization (with OR) and table joinssheeri kritzer4 May
      • Re: Index merge optimization (with OR) and table joinssheeri kritzer4 May
  • Re: A complex JOIN scenarioMartijn Tonies11 Apr
    • Re: A complex JOIN scenarioKim Christensen11 Apr
  • Re: A complex JOIN scenarioSantino11 Apr
  • Re: Index merge optimization (with OR) and table joinsStuart Brooks23 May
Re: A complex JOIN scenarioKim Christensen11 Apr
  • Innodb import tuning on Sun T2000Russell Horn7 Jul