Delete imported records based on record in another table

Discussion created by MattLeach on Mar 21, 2013
Latest reply on Mar 24, 2013 by MattLeach

Have a 2 table solution that is setup as follows:


Table 1 = Brands

Table 2 = Products


The products table is going to be populated by importing a csv file on a regular basis. Once this file is imported, i have a script that loops through the imported records and flags them for deletion if they meet certain criteria.


In the Products table there is a field for brand. What i would like to add to the script is that if the Product's Brand matches a record in the Brands table, flag it for deletion.


What would be the best approach for the above scenario?