DELETE with INNER JOIN

  • Hello!

    Is it possible to have a delete syntax in sql with inner join inside it? it's possible in access - so I can't make it work in SQL. Am I right about this one.

    Here is the Access syntax - was hoping anyone could help me to do this in SQL!

    sSQL =

    "DELETE PIPES.*, ITEM.SWCode FROM ITEM INNER JOIN PIPES ON (ITEM.ItemNo = PIPES.iPartID) AND (ITEM.SWCode = PIPES.sPostID) WHERE (((ITEM.SWCode)='"+sPostID+"'));";


    -Lars

    Please only reply to this newsgroup. All mails would be bounced back.

  • DELETE Pipes

    FROM Item a INNER JOIN Pipes b

    ON a.ItemNo = b.IPartID

    AND a.SWCode = b.SPostID

    WHERE a.SWCode = @Variable

    This will delete from pipes all the records that exists on both tables.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply