MySQL Forums
Forum List  »  Oracle

Re: converting join in Oracle to mysql
Posted by: Roland Bouman
Date: April 05, 2007 02:35AM

Hi!

first of all, you really should take a look here:

http://dev.mysql.com/doc/refman/5.0/en/sql-syntax.html

Really, there is no substitute for the documentation. Now for your acute problem:

MySQL supports many Oracle-isms in it's SQL syntax: I'm glad the outer join syntax is not one of them ;) In MySQL, you can write a proper LEFT JOIN for that. There is also something call RIGHT JOIN, but lets not go there right now.

Your joins are all left joins and can be rewritten real quick to fit MySQL:


FROM cq_hierarchy h
LEFT JOIN cq_hierarchy_calc_config calc
ON h.hierarchy_id = calc.hierarchy_id
LEFT JOIN cq_xdb xdb
ON calc.xdb_id = xdb.xdb_id
LEFT JOIN cq_hierarchy_web_config web
ON h.hierarchy_id = web.hierarchy_id
LEFT JOIN cq_timezone tz
ON web.timezone_id = tz.timezone_id


Note that I reordered the tables - that is just because I like to make continuous join paths as long as can be - it does not affect the result.

Options: ReplyQuote


Subject
Views
Written By
Posted
5514
April 04, 2007 05:13AM
Re: converting join in Oracle to mysql
8623
April 05, 2007 02:35AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.