Using wp_query to query database

Instead of querying database manually using $wpdb