I want to use custom post type in my custom SQL query, but, when I add the custom post type im my query, I get no results.
Where's my probelm ?
This is the code I've tried
$top5_ov_performance = $wpdb->get_results("SELECT post_id,meta_value FROM ".$wpdb->prefix."postmeta WHERE meta_key = 'sd_top5_overclocing' AND (post_type = 'cpu') ORDER BY meta_value DESC LIMIT 0,5 ");
I have also tried this post_type = 'cpu'
instead of (post_type = 'cpu')
and and
instead of AND