List:General Discussion« Previous MessageNext Message »
From:Dawid Kuroczko Date:July 18 2005 5:19pm
Subject:Re: Impossible join?
View as plain text  
On 7/16/05, Jonathan Mangin <jon.mangin@stripped> wrote:
> Hello all,
> 
> I'm storing data from a series of tests throughout each
> 24-hour period.  I thought to create a table for each test.
> (There are six tests, lots more cols per test, and many
> users performing each test.)
> 
> select test1.date, test1.time, test2.date, test2.time from
> test1 left join test2 on test2.date=test1.date where
> test1.date between '2005-07-01' and '2005-07-16' and
> uid='me';
> 
> +------------+------+------------+------+
> | date       | time | date       | time |
> +------------+------+------------+------+
> | 2005-07-13 | 6:30 | 2005-07-13 | 7:30 |
> | 2005-07-14 | 6:32 | 2005-07-14 | 7:45 |
> | 2005-07-15 | 6:30 | 2005-07-15 | 7:42 |
> | 2005-07-16 | 6:35 | NULL       | NULL |
> +------------+------+------------+------+
> 
> Is there a join, or some other technique, that would
> return (nearly) these same results if test1 (or any test)
> has not been performed?  Using 4.1.11.

You would need a full outer join, but MySQL doesn't support it... :(

You need some way to hack around it.  Maybe ditch the JOIN clauses
and join tables in application, for instance using hashes?

   Regards,
      Dawid
Thread
Impossible join?Jonathan Mangin16 Jul
  • Re: Impossible join?Michael Stassen16 Jul
  • Re: Impossible join?Jonathan Mangin18 Jul
  • Re: Impossible join?Dawid Kuroczko18 Jul
RE: Impossible join?Gordon Bruce18 Jul