I'm trying to delete records on table based on another table its status.
delete from hp_visitors_data
left join hp_programs_list
on hp_visitors_data.visitor_program_viewed = hp_programs_list.id
where hp_programs_list.program_add_status = 3
group by hp_visitors_data.visitor_program_viewed
But I keep getting an error, what I'm doing wrong?
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'left join hp_programs_list on hp_visitors_data.visitor_program_viewed = hp_pro' at line 2