SELECT products.name from products WHERE products.id
NOT IN ( SELECT DISTINCT(products.id) FROM timer_completed
INNER JOIN com_jobcard ON com_jobcard.id = timer_completed.job_card_id
INNER JOIN products ON products.id = com_jobcard.product_id)
In the above query SELECT DISTINCT(products.id) FROM timer_completed
will return multiple values but I need the products which are not in that result set, so I have used NOT IN
function but it returns error. Could you suggest me a better way to achieve this.