Export SQL query based on custom field?

Change your query to:

SELECT wp_posts.* FROM wp_posts INNER JOIN wp_postmeta ON wp_postmeta.post_ID = wp_posts.ID WHERE ( wp_postmeta.meta_key = 'Color' AND wp_postmeta.meta_value IS NOT NULL );

That way it only gets the data in wp_posts, but still filters based on your criteria.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)