SELECT Posts.*, IF(Action.Id IS NULL,0,1) as Deleted
FROM Posts
LEFT JOIN Action
ON Action.Target = Posts.Id and Type='delete'
If you don't care about perfomance
SELECT Posts.*,
exists
(SELECT 1
FROM Action
WHERE Target = Posts.Id
AND TYPE='delete') AS Deleted
FROM Posts