If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Mysql join predicate not working

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-11-03, 17:44
arunpers arunpers is offline
Registered User
 
Join Date: Dec 2003
Posts: 2
Red face 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?
Reply With Quote
  #2 (permalink)  
Old 12-11-03, 18:00
r937 r937 is online now
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,533
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/
Reply With Quote
  #3 (permalink)  
Old 12-11-03, 21:52
arunpers arunpers is offline
Registered User
 
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??
Reply With Quote
  #4 (permalink)  
Old 12-12-03, 04:24
r937 r937 is online now
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,533
because it's a separate product
Quote:
"MaxDB complements MySQL AB’s flagship MySQL® database... MaxDB by MySQL is a re-branded and enhanced version of SAP DB, SAP AG’s (NYSE: SAP) open source database.... MaxDB joins MySQL AB’s flagship product, the MySQL database server, in the MySQL AB database product line-up."
-- http://www.mysql.com/press/release_2003_35.html
rudy
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On