delete data from two tables at the same time in mysql


delete record from two table in same time in mysql 

it is useful when we create two related table in mysql   

 // with inner join 

DELETE tb1, tb2 FROM tb1 inner JOIN tb2  WHERE tb1.id=tb2.tb1id and tb1.id=1



 // with left or Right Join 

DELETE tb1, tb2 FROM tb1 LEFT JOIN tb2 ON tb1.id=tb2.tb1id  WHERE tb1.id=1

Comments

  1. superb.....blog is much interesting which engaged me more.Spend a worthful time.keep updating more.
    ecommerce website developers in hyderabad

    ReplyDelete

Post a Comment

If you Satisfied , Please Leave a comment

Popular posts from this blog

Call PHP Function In JavaScript Using Ajax

List of Post Category Wise in wordpress