This mysql query help to get data from the wp_posts table of the wordpress.It will get any data from the wp_post table.Only you have to set the condition in the WHERE clause of this query.