Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2003
    Location
    Mars
    Posts
    115

    Unanswered: Delete from Multiple tables

    Hello:

    Mysql Version: 5x
    DB Engine: InnoDB
    I m new to Mysql

    I want to delete records from multiple tables account_id being common in all as shown below.



    Declare @account_id as char(4)
    set @account_id= '500'
    select * from promotion_products a,product_subscription_tiers b,product_features c,product_entitlement d,entitlements e,product f,contract_item g
    where a.product_id=b.product_id and b.product_id=c.product_id and c.product_id=d.product_id and d.product_id=e.product_id and e.product_id=f.product_id and f.product_id=g.product_id and g.account_id=@account_id



    TIA
    Adil

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by aadil View Post
    I m new to Mysql
    in that case my advice to you is to delete the desired rows from one table at a time
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

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