Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2003
    Posts
    2

    Red face Unanswered: Mysql join predicate not working

    Hi all,
    I am trying to migrate an application from oracle to mysql and have trouble getting the join predicates work. I am using MySql 4.1 alpha version.

    This is the query i want to use:
    SELECT *
    FROM
    requirement r,
    ref_source s
    WHERE
    r.project_id = 0 AND
    r.source_code = s.source_code (+);

    I see examples of such queries on the MySql site but cannot seem to make it work. The datatype of the source_code columns in both the tables are the same char(2).

    Any suggestions on what i am missing?

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    mysql does not support the oracle proprietary "plus sign" syntax for outer joins

    instead, just use the standard join syntax
    Code:
    select *
      from requirement r
    left outer
      join ref_source s
        on r.source_code = s.source_code 
     where r.project_id = 0
    rudy
    http://r937.com/

  3. #3
    Join Date
    Dec 2003
    Posts
    2

    Smile MaxDB confusion

    Thanks rudy. I realized now that I have searched the MaxDb manuals and found the syntax using oracle style (+)... By the way, why is maxDB seperate from MySql??

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    because it's a separate product
    "MaxDB complements MySQL ABs flagship MySQL database... MaxDB by MySQL is a re-branded and enhanced version of SAP DB, SAP AGs (NYSE: SAP) open source database.... MaxDB joins MySQL ABs flagship product, the MySQL database server, in the MySQL AB database product line-up."
    -- http://www.mysql.com/press/release_2003_35.html
    rudy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •