[摘抄]MySQL分组后获取每个分组下的4笔数据
SELECT
c.*, DATE_FORMAT(c.CREATE_TIME, '%Y-%m-%d') DATE
FROM
cms_content c
WHERE
1 = 1
AND c.TYPE_KEY = 'firm'
AND (
SELECT
COUNT(*)
FROM
cms_content
WHERE
org_id = c.org_id
AND TYPE_KEY
转载
2015-04-30 16:21:51 ·
436 阅读 ·
0 评论