Hello @kartik,
Set posts_per_page parameter in args to -1, this will return all posts from wp_posts table.
For example:
$args = array(
'posts_per_page' => -1,
'post_type' => 'post',
);
$the_query = new WP_Query( $args );
Now you can loop through and get posts
while ( $the_query->have_posts() ) {
// go ahead
}
Hope this work!!
Thank You!