Hi,
I want to summ my field ‘nb’ from my post_type ‘exploitation’, i don’t understand what is wrong with this…Thanks for help
$total = $wpdb->get_col(“SELECT SUM(pm.meta_value) FROM {$wpdb->postmeta} pm
INNER JOIN {$wpdb->posts} p ON p.ID = pm.post_id
WHERE pm.meta_key = ‘nb’
AND p.post_type = ‘exploitations'”);