How to get posts from a current post’s month?

There is date_query which can handle this and an SQL query is not a good practice when you can take advantage of WordPress Query API:

$pid = 1; // post ID here

$args = array(
    'posts_per_page' => -1,
    'post_type' => 'post',
    'date_query' => array(
        array(
            'year'  => get_the_date('Y', $pid),
            'month' => get_the_date('m', $pid)
        ),
    ),
);

$posts = get_posts( $args );

print_r( $posts );

Hope that helps.