I don't really have an elegant solution for this, but something like the following might work (all untested, though, so take it with a grain of salt).
First you need to identify the IDs of the questions you want to keep:
SELECT min(postid)
FROM qa_posts
WHERE type='Q'
GROUP BY title;
Now you can delete answers to duplicate question by deleting posts with type "A" whose parent ID is not in that list:
DELETE FROM qa_posts
WHERE type='A' AND parentid NOT IN (
SELECT min(postid)
FROM qa_posts
WHERE type='Q'
GROUP BY title;
);
and duplicate questions by deleting post with type "Q" whose post ID is not in that list:
DELETE FROM qa_posts
WHERE type='Q' AND postid NOT IN (
SELECT min(postid)
FROM qa_posts
WHERE type='Q'
GROUP BY title;
);