Consulting

Results 1 to 2 of 2

Thread: Delete Query with two joins to a Query

  1. #1
    VBAX Regular
    Joined
    Jul 2016
    Posts
    22
    Location

    Delete Query with two joins to a Query

    Hi all,

    I'm trying to create a DELETE query with a table that has two joins to a Query. Is this possible?

    This is what I have so far but is not working.

    DELETE *FROM LV_TEST_UNQ
    WHERE EXISTS
        (SELECT *
          FROM vMST_Max_NotLV
          WHERE vMST_Max_NotLV.AccessionNumber = LV_TEST_UNQ.AccNo AND vMST_Max_NotLV.OrderCodes = LV_TEST_UNQ.TestCode);

    Any ideas welcomed

  2. #2
    VBAX Regular
    Joined
    Jul 2016
    Posts
    22
    Location
    I think I just figured this out via this query:


    DELETE *FROM LV_TEST_UNQ
    WHERE EXISTS
        (SELECT *
          FROM vMST_Max_NotLV
          WHERE vMST_Max_NotLV.AccessionNumber = LV_TEST_UNQ.AccNo)
    AND EXISTS
        (SELECT *
          FROM vMST_Max_NotLV
          WHERE vMST_Max_NotLV.OrderCodes = LV_TEST_UNQ.TestCode);

Posting Permissions

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