* [EMAIL PROTECTED]
> I'm new to MySQL and have tried many attempts myself and looked
> all over for
> this answer to no avail.  How do I write MySQL joins to accomodate the
> Oracle equivalent listed below........any help would be appreciated.
>
> From
>   iteration,
>   story,
>   person tracker,
>   person customer,
>   person developer,
>   task,
>   time_entry
> Where
>   iteration.id=story.iteration_id and
>   story.tracker_id=tracker.id(+) and
>   story.id=task.story_id(+) and
>   story.customer_id=customer.id(+) and
>   task.acceptor_id=developer.id(+) and
>   task.id=time_entry.task_id(+)
>
> I've got this so far, but it seems to be returning a cartesian product
> between iteration and story
>
[...]

Ouch. I find this syntax easier:

From
  iteration
  left join story on iteration.id=story.iteration_id
  left join person tracker on story.tracker_id=tracker.id
  left join person customer on story.customer_id=customer.id
  left join task on story.id=task.story_id
  left join person developer on task.acceptor_id=developer.id
  left time_entry on task.id=time_entry.task_id

The WHERE clause is eliminated in this case. Had to move task before
developer, the tables are read in the order you provide when using left
joins.

<URL: http://www.mysql.com/doc/en/JOIN.html >

--
Roger


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to