Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

As CMS I use Wordpress. I want to export a whole category (windows 8) so I run the SQL command :

SELECT * FROM wp_posts
INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id)
INNER JOIN wp_term_taxonomy ON (wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id)
WHERE (wp_term_taxonomy.term_id = 15
   AND wp_term_taxonomy.taxonomy = 'category'
   AND wp_posts.post_type = 'post'
   AND wp_posts.post_status = 'publish');

I get the tables but then I cannot export as SQL (there is no option) - strange. Is there a way to export only selected tables as SQL?

enter image description here

share|improve this question
odds are that it cannot generate the corresponding sql as it touches multiple tables. you will need to export each table to generate the sql. otherwise, suck it up and export to csv and write your loader – billinkc Oct 26 '13 at 17:25
Or you can use SELECT INTO to create a table, populate it with the needed data and then export the table to the SQL dump. – BuahahaXD Apr 7 '15 at 15:38

I get this effect only when applying a query.

A table, view, or other direct structure seems to export into SQL fine.

The SQL option seems is not available to a query result set, very sadly.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.