Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2003
    Posts
    30

    Unanswered: 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

  2. #2
    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.

Posting Permissions

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