List:General Discussion« Previous MessageNext Message »
From:Baron Schwartz Date:August 31 2007 1:30pm
Subject:Re: JOIN migration from Oracle to MySQL
View as plain text  
spikerlion@stripped wrote:
> Hello,
> 
> I've two LEFT OUTER JOINS in the WHERE section in an Oracle script like:
> 
> select ...
> from...
> where
> ...
> and PT1.ID (+) = bl.PARENTTYPE_1
> and PT2.ID (+) = bl.PARENTTYPE_2
> ...
> 
> 
> MySQL knows LEFT OUTER JOINS in the FROM section but two joins with the same table
> aren't accepted.
> 
> example:
> select ...
> from
> tableA PT1 LEFT OUTER JOIN tableC bl ON (PT1.ID = bl.PARENTTYPE_1), 
> tableB PT2 LEFT OUTER JOIN tableC bl ON (and PT2.ID = bl.PARENTTYPE_2),

The exact error message would be helpful, but I'm seeing at least two 
problems:

1) you're aliasing two tables as 'bl'.  The aliases need to be unique.
2) The second ON clause shouldn't start with AND.

Otherwise you should have no problem doing this.
Thread
JOIN migration from Oracle to MySQLspikerlion31 Aug
  • Re: JOIN migration from Oracle to MySQLBaron Schwartz31 Aug
    • Re: JOIN migration from Oracle to MySQLspikerlion31 Aug
      • Re: JOIN migration from Oracle to MySQLShawn Green31 Aug