DELETE WorkRecord2
FROM WorkRecord2
INNER JOIN Employee
ON EmployeeRun=EmployeeNo
WHERE Company = '1'
AND Date = '2013-05-06';
DELETE P
FROM target_profile_tbl P
LEFT JOIN target_tbl I ON P.id = I.profile_id
WHERE I.id = (SELECT profile_name FROM target_profile_tbl WHERE profile_name = '')