select * from `wp_posts` left join `wp_term_relationships` on `wp_posts`.`ID` = `wp_term_relationships`.`object_id` left join `wp_term_taxonomy` on `wp_term_relationships`.`term_taxonomy_id` = `wp_term_taxonomy`.`term_taxonomy_id` left join `wp_terms` on `wp_terms`.`term_id` = `wp_term_taxonomy`.`term_id` left join `wp_postmeta` on `wp_postmeta`.`post_id` = `wp_posts`.`ID` left join `wp_postmeta` as `wtt2` on `wtt2`.`post_id` = `wp_posts`.`ID` where `wtt2`.`meta_key` = ? and `wtt2`.`meta_value` > ? and `wp_postmeta`.`meta_key` = ? and `wp_postmeta`.`meta_value` > ? and `wp_posts`.`post_status` = ? and `wp_term_taxonomy`.`taxonomy` = ? and `wp_terms`.`slug` = ? order by CAST(wtt2.meta_value AS DECIMAL(10,2))