0

I need to remove associated id from 2 different tables. For example, when I delete the id 1 of PulseTables I want all the id_table 1 of PulseTasks to be automatically deleted. Is this possible and how?

Table 1

Table 2

Bibhudatta Sahoo
  • 4,808
  • 2
  • 27
  • 51
  • 1
    It is called `DELETE CASCADE` see http://stackoverflow.com/questions/511361/how-do-i-use-on-delete-cascade-in-mysql – Sean Nov 28 '16 at 00:14
  • Umm .. Try this! **http://stackoverflow.com/questions/14953624/how-to-delete-records-not-in** – Pinguto Nov 28 '16 at 00:21
  • do you want it by mysql query ? then normally use 2 query or you need to set FOREIGN key https://www.w3schools.com/sql/sql_foreignkey.asp – Shafiqul Islam Jul 20 '17 at 07:46

0 Answers0