Try this solution, Assuming the template name is
$query = new WP_Query(
'post_type' => 'page',
'meta_key' => '_wp_page_template',
'meta_value' => 'my_template.php'
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.