global $wpdb;
$minsql = "SELECT MIN(meta_value) FROM $wpdb->postmeta WHERE meta_key = %s AND meta_value<>0 AND meta_value IS NOT NULL";
$maxsql = "SELECT MAX(meta_value) FROM $wpdb->postmeta WHERE meta_key = %s AND meta_value<>0 AND meta_value IS NOT NULL";
$minPrice = $wpdb->get_var($wpdb->prepare($minsql, '_price'));
$maxPrice = $wpdb->get_var($wpdb->prepare($maxsql, '_price'));