Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: JOIN migration from Oracle to MySQL

From: <spikerlion(at)gmx.de>
Date: Fri Aug 31 2007 - 10:38:18 EDT


Hello,

thank you - now it works.

d_parenttype PT1 LEFT OUTER JOIN t_booklists bl ON (PT1.ID = bl.PARENTTYPE_1), d_parenttype PT2 LEFT OUTER JOIN t_booklists bk ON (PT2.ID = bk.PARENTTYPE_2)

I had to put the alias to all listet fields in the select.

regards,
Spiker

  • Original-Nachricht --------
    > Datum: Fri, 31 Aug 2007 09:30:13 -0400
    > Von: Baron Schwartz <baron@xaprb.com>
    > An: spikerlion@gmx.de
    > CC: mysql@lists.mysql.com
    > Betreff: Re: JOIN migration from Oracle to MySQL

> spikerlion@gmx.de 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.

-- 
Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten 
Browser-Versionen downloaden: 
http://www.gmx.net/de/go/browser

-- 
MySQL General Mailing List
For list archives: 
http://lists.mysql.com/mysql
To unsubscribe:    
http://lists.mysql.com/mysql?unsub=lists@pantek.com
Received on Fri Aug 31 10:47:19 2007

This archive was generated by hypermail 2.1.8 : Sun Oct 07 2007 - 10:08:19 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library