View Single Post

   
  #4 (permalink)  
Old 02-28-2008, 07:00 AM
Shawn Green
 
Posts: n/a
Default Re: JOIN migration from Oracle to MySQL

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


Unless you are relating PT1 to PT2 in some way, you should not expect
this query to perform well because you will be generating a Cartesian
product between PT1 and PT2. I doubt this is actually what you are
trying to do (although it will eventually work). If you posted just a
few more details about the query you are trying to write, we could try
to help you to rewrite it in a way that will perform much better than
the translation you just attempted.
--
Shawn Green, Support Engineer
MySQL Inc., USA, www.mysql.com
Office: Blountville, TN
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ /
/ /|_/ / // /\ \/ /_/ / /__
/_/ /_/\_, /___/\___\_\___/
<___/
Join the Quality Contribution Program Today!
http://dev.mysql.com/qualitycontribution.html
Reply With Quote