Hi,
I am trying to select a set of similar data in 5 tables and delete rows in another table that do not contain matches to this data. I basically want to clump all 'col1' together (with a join?) in table1,table2,table3,table4,table5, and compare these values to 'col1' in table6. It would be nice to do it in one statement, but I lack the knowledge to pull it off right now.
Here my prelim setup, but I'm stuck!
Thanks For Your Help!
I am trying to select a set of similar data in 5 tables and delete rows in another table that do not contain matches to this data. I basically want to clump all 'col1' together (with a join?) in table1,table2,table3,table4,table5, and compare these values to 'col1' in table6. It would be nice to do it in one statement, but I lack the knowledge to pull it off right now.
Here my prelim setup, but I'm stuck!
Code:
$query1 = "SELECT table1.col1, table2.col1, table3.col1, table4.col1, table5.col1 FROM table1, table2, table3, table4, table5";
$query2 = "DELETE FROM table6 WHERE (table6.col1 != table1.col1) AND (table6.col1 != table2.col1) AND (table6.col1 != table3.col1) AND (table6.col1 != table4.col1) AND (table6.col1 != table5.col1)";
Thanks For Your Help!