主题:group by 分页

dingcc 2020年06月08日 46


select @pageTag(){ a.*, count(distinct(b.applicant_id)) ent_num, count(c.ent_post_name) post_num, sum(c.num) recruit_num @}from ent_recruit_activity a left join ent_recruit_activity_apply b on a.id = b.recruit_activity_id left join ent_post_info c on b.applicant_id = c.ent_id where a.activity_type = 1 and b.applicant_type = 2 @if(!isEmpty(activity_name)){ AND a.activity_name like CONCAT('%',#activity_name#,'%')@}group by a.id, a.activity_name, a.create_time;

闲大赋 2020年06月12日

group 分页有问题,需要用子查询方式

select #page()# from ( select * from xxx group by )