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 > DB2 > join (DB2/400 vs DB2 UDB Windows)

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-02-03, 06:35
loge loge is offline
Registered User
 
Join Date: Nov 2003
Posts: 30
join (DB2/400 vs DB2 UDB Windows)

Hi,

on my iSeries the following join perfectly runs:

select a.companynumber, a.locationnumber, a.chainstorenumber, a.username, a.usertext, a.passwordchangedate, a.email, a.lotususername, b.locationname, c.name, a.validfrom, a.validto, a.password
from j_jus a, j_loc b
left join j_ms c
on a.companynumber = c.companynumber and a.chainstorenumber = c.chainstorenumber
where a.companynumber = b.companynumber and a.locationnumber = b.locationnumber

on Windows DB2 this results in a error, can somebody give me a hint why this doesnt work on Windows DB2 ?

Thanks
Reply With Quote
  #2 (permalink)  
Old 12-02-03, 10:06
loge loge is offline
Registered User
 
Join Date: Nov 2003
Posts: 30
i will reply to myself, it was a little bit tricky, because it was too easy ;-)

changing the tables in the from of the inner join, like:

from j_loc b, j_jus a

did the trick. I referenced in the left join columns of table "a", but table "b" was defined next before the join. So the ON clause could only see columns of "b" instead of "a".

Crazy that on DB/400, he dont care about the position of the tables in the inner join.
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