Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2002
    Posts
    5

    Unanswered: Update Join in DB2

    Hi All

    Following is the SQL Server query.

    UPDATE titles
    SET price = price * 2
    FROM titles INNER JOIN publishers ON titles.pub_id = publishers.pub_id
    AND pub_name = 'New Moon Books'

    'FROM' is not acceptable in DB2. Can you please help me to find what is the matching query in DB2.

    Thanks in Advance.

  2. #2
    Join Date
    Apr 2003
    Posts
    191

    Re: Update Join in DB2

    Hi senthilks,

    what about this:

    update titles
    set price = price * 2
    where pub_id in
    ( select pub_id from publishers where pub_name = 'New Moon Books' )

    Johann

    Originally posted by senthilks
    Hi All

    Following is the SQL Server query.

    UPDATE titles
    SET price = price * 2
    FROM titles INNER JOIN publishers ON titles.pub_id = publishers.pub_id
    AND pub_name = 'New Moon Books'

    'FROM' is not acceptable in DB2. Can you please help me to find what is the matching query in DB2.

    Thanks in Advance.

  3. #3
    Join Date
    Jan 2003
    Posts
    1,605

    Re: Update Join in DB2

    Hi,

    You have to write bracket after on ...

    UPDATE titles
    SET price = price * 2
    FROM titles INNER JOIN publishers ON (titles.pub_id = publishers.pub_id
    AND pub_name = 'New Moon Books')

    Hope it helps,
    Grofaty

Posting Permissions

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