I have two tables one table has all my products and the next table has all of my sales.
I would like to create a script that would delete all the products in my products table that has no sales and has a status code of D (D - Delete)
This is what I have so far, but it is not working.
Select * from products as p, salesasb as s
where s.companyno=p.companyno and s.itemno<>p.sku and
p.companyno='4' and p.statuscode='D'
any help would be great !!