When moving from a stage site to production, sometimes it’s necessary to update the GUIDs. Doing a quick REPLACE() is an easy way to accomplish this.
UPDATE wp_posts
SET guid = REPLACE(guid, 'http://stage.somesite.com', 'http://www.somesite.com')
WHERE guid LIKE '%http://stage.somesite.com%'
DELETE a,b,c
FROM wp_posts a
LEFT JOIN wp_term_relationships b ON ( a.ID = b.object_id )
LEFT JOIN wp_postmeta c ON ( a.ID = c.post_id )
LEFT JOIN wp_term_taxonomy d ON ( d.term_taxonomy_id = b.term_taxonomy_id )
LEFT JOIN wp_terms e ON ( e.term_id = d.term_id )
WHERE a.post_type = 'listing'
'Word document' and 'website' don't really go together…