Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2004
    Posts
    43

    Unanswered: delete query with inner join

    Hallo,

    Can anybody let me know what I need to change to make this query work:

    delete
    from a
    inner b
    on a.item = b.item

    I get the error message "Incorrect syntax near the keyword 'inner'."

    Thanks,
    Stephen.

  2. #2
    Join Date
    Mar 2005
    Posts
    92
    Quote Originally Posted by steve_o
    Hallo,

    Can anybody let me know what I need to change to make this query work:

    delete
    from a
    inner b
    on a.item = b.item

    I get the error message "Incorrect syntax near the keyword 'inner'."

    Thanks,
    Stephen.
    Have you tried?

    INNER JOIN b on...

  3. #3
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Hi Steve o

    Key word is join rather than inner. Also, you'll need to use an EXISTS or IN statement rather than a join if you are deleting

    HTH
    Testimonial:
    pootle flump
    ur codings are working excelent.

  4. #4
    Join Date
    Jun 2003
    Posts
    269

    Thumbs up Re

    Check BOL for delete statment,
    Here is the corect syntax,
    Code:
    delete a
    from a
    inner join b
    on a.item = b.item
    I love cursor,though I never use it.Cos' I dont want to misuse it.
    ----------------------------------------------

    ----cheers
    ----http://mallier.blogspot.com

Posting Permissions

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