0

I want to Delete Record from Two different Table but i join those table using Left join

DELETE tab_issue.tab_issueID, tab_return.tab_issueID
FROM tab_issue
INNER JOIN tab_return
WHERE tab_issue.tab_issueID = tab_return.tab_issueID

I have no strong concept on sQL if someone have simple query which solve my issue. I am using mySQL database

Thorsten Kettner
  • 89,309
  • 7
  • 49
  • 73
Awais Butt
  • 15
  • 6

1 Answers1

0

This should do the trick.

DELETE tab_issue, tab_return
FROM tab_issue INNER JOIN tab_return
ON tab_issue.tab_issueID = tab_return.tab_issueID;
Ely
  • 10,860
  • 4
  • 43
  • 64
  • but i want to delete single record on click its delete whole data from table..??? – Awais Butt Jun 06 '17 at 17:18
  • This delete records of both tables, which have the same `tab_issueID` in both both tables. – Ely Jun 06 '17 at 17:32
  • I am afraid your question is not well understood. Maybe you can try to give an example of tables with data and what those tables might look like after the `delete` statement is executed ? – Ely Jun 07 '17 at 17:52