Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2002
    Location
    New Jersey
    Posts
    39

    Unanswered: Delete from multiple tables with one query

    I'd like to delete all the items with a specific item code that exist in several tables;

    I'm tried variations on the following 2 queries:
    Code:
    DELETE FROM menu_item, rec_blurb, rec_yield, recipe_ingredient_data WHERE rec_code = 'id3d88710d8'
    Code:
    DELETE FROM menu_item m, recipe_ingredient_data r, rec_yield y, rec_blurb b
    WHERE
    m.rec_code = 'id3d88710d8'
    AND r.rec_code = 'id3d88710d8'
    AND y.rec_code = 'id3d88710d8'
    AND b.rec_code = 'id3d88710d8'
    Unfortunately I get an error.

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    multi-table deletes are supported only starting from mysql version 4

    check 6.4.6 DELETE Syntax

    rudy
    http://rudy.ca/

  3. #3
    Join Date
    Feb 2002
    Location
    New Jersey
    Posts
    39
    Darn, I was afraid of that...many thanks,

    Pete

Posting Permissions

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