SELECT $wpdb->posts. * FROM $wpdb->posts, $wpdb->postmeta WHERE $wpdb->posts.ID = $wpdb->postmeta.post_id AND $wpdb->postmeta.meta_key = 'productcode' AND $wpdb->posts.post_status = 'publish' AND $wpdb->posts.post_type = 'post' AND $wpdb->posts.post_date < NOW( ) AND $wpdb->postmeta.meta_value = $wpdb->postmeta.meta_value GROUP BY $wpdb->postmeta.meta_value HAVING count( * ) >1 ORDER BY $wpdb->posts.post_date DESC
No comments:
Post a Comment