I have 3 tables in MySQL 5.5 :
product
id_product int primary
product_name varchar
creation_id int (index)
product_life
id_product_life int primary
product_event_name varchar
product_id int (index)
creation_id int (index)
date_created
id_creation int primary
date_creation datetime
- "creation_id" from product and product_life tables are foreign keys (without constraint) for primary key id_creation of date_created table
- "product_id" from product_life table is foreign key (without constraint) for primary key id_product of product table
I need to retrieve the number of products created on a specific day (date_creation >= '2014-08-01 00:00:00' AND date_creation <= '2014-08-01 23:59:59'
) but these products must have no records in product_life
table having a date_creation >= '2014-08-10 00:00:00'
I tried with an INNER JOIN on the 3 tables but it doesn't work. Thanks for your help.