From the Revisions documentation page:
Revisions are stored in the posts table.
Revisions are stored as children of their associated post (the same thing we do for attachments). They are given a
post_status
ofinherit
, apost_type
ofrevision
, and apost_name
of{parent ID}- revision(-#)
for regular revisions and{parent ID}-autosave
for autosaves.
So you should be able to search the wp_posts
table for posts where the post_type
is revision
, and then grab the post_parent
ID to find the original post.
Update
If you’re looking for an SQL query, here’s one I just tried that seemed to work:
SELECT ID, post_title
FROM wp_posts
WHERE ID IN (
SELECT DISTINCT post_parent
FROM wp_posts
WHERE post_type="revision"
);
…assuming your posts table has the default name wp_posts
.