I use this SQL statement:
SELECT * FROM wp_posts
LEFT JOIN wp_term_relationships ON ( wp_posts.ID = wp_term_relationships.object_id )
LEFT JOIN wp_term_taxonomy ON ( wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id )
WHERE wp_posts.post_type = 'post'
AND wp_posts.post_status = 'publish'
AND wp_posts.post_status != 'draft'
AND wp_term_taxonomy.term_id = 17
OR wp_term_taxonomy.term_id = 18
OR wp_term_taxonomy.term_id = 19
ORDER BY post_date_gmt DESC
LIMIT 6
OFFSET 6
but result of this show posts that have post_status = draft
.
Why this happening?