SQL Get X last entries from a 'custom' post_type counting users individual number of custom post_type
问题 I would like, if possible to get in one query: The last 4 different users Excluding 'ID' = '1' WITH post_type = 'custom' Ordered by date or ID ( DESC ) Counting the total number of 'custom' post_type for each user (COUNT()) Here is a data example: Table Name: 'post' ID | user | Date | title | status | post_type | | | | | "2785" | "1" | "2016-05-24 18:49:15" | "Title" | "published" | "page_post" "2783" | "5" | "2016-05-24 11:24:08" | "Title" | "published" | "custom" "2781" | "1" | "2016-05-18