multiple table delete query error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ray

    #1

    multiple table delete query error

    Hello all,

    I am attempting to delete multiple rows from multiple tables as
    follows:

    DELETE FROM attachments,res ponses,response _lines WHERE attachments.id
    IN(2,7,11) AND responses.attac hment_id=attach ments.id AND
    response_lines. response_id=res ponses.id

    The error message it returns is:

    MySQL Error: You have an error in your SQL syntax near
    'responses,resp onse_lines WHERE attachments.id IN(2,7,11) AND
    responses.attac hment_id=' at line 1

    I have tried every construct described at
    http://www.mysql.com/doc/en/DELETE.html and always receive the same
    error.

    Any suggestions?

    -r
  • Aggro

    #2
    Re: multiple table delete query error

    Ray wrote:[color=blue]
    > Hello all,
    >
    > I am attempting to delete multiple rows from multiple tables as
    > follows:[/color]

    What version of MySQL are you using?

    "The first multiple-table delete format is supported starting from MySQL
    4.0.0. The second multiple-table delete format is supported starting
    from MySQL 4.0.2"

    Comment

    Working...