Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003
    Posts
    233

    Unanswered: Updating using derived table err:

    Below is my sql, i am getting error msg "Incorrect sytax near 'Votes'."
    Can anyone tell me what im doin wrong?

    UPDATE #TblExposure
    SET E.Unity =
    (
    SELECT
    -- DealId ,DocketId,
    CASE Participant2
    WHEN null THEN 'NA'
    ELSE
    CASE WHEN Participant2-Vote2 =0 THEN 'Yes'
    ELSE 'No'
    END
    END AS Unanimous1
    FROM #tblVoting
    ) Votes
    FROM #tblExposure E INNER JOIN Votes
    ON Votes.Dealid = E.Dealid
    AND Votes.DocketId =E.DocketId

  2. #2
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    UPDATE E --#TblExposure
    SET E.Unity =
    (
    SELECT
    -- DealId ,DocketId,
    CASE Participant2
    WHEN null THEN 'NA'
    ELSE
    CASE WHEN Participant2-Vote2 =0 THEN 'Yes'
    ELSE 'No'
    END
    END AS Unanimous1
    FROM #tblVoting
    ) Votes
    FROM #tblExposure E INNER JOIN Votes
    ON Votes.Dealid = E.Dealid
    AND Votes.DocketId =E.DocketId
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

Posting Permissions

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