flappyfish 2017-11-14 02:45 采纳率: 100%
浏览 3392
已采纳

mybatis执行select子查询分页报错

select
    adr.modifiedname,
    adr.modifiedon,
    adr.comment_tag,
    adr.post_desc,
    adr.qualifications,
    (
    SELECT
                GROUP_CONCAT(r.user_name)
                FROM
                post_recruiter_related r
                WHERE
                r.post_id =  ah.post_id
                AND r.isdeleted = 0
    ) AS recruitPersons
    from ad_headhunter_related ah LEFT JOIN ad_release_record adr ON ah.post_id = adr.post_id
    where adr.isdeleted=0
   HAVING recruitPersons like '%杰%'
    ORDER by ah.create_time DESC

我有一条sql语句,其中select里面有一个子句关联另一张表,这条sql单独执行没问题,但是配合PageHelper分页就报错,提示“ SELECT count(0) FROM ad_headhunter_related ah LEFT JOIN ad_release_record adr ON ah.post_id = adr.post_id WHERE adr.isdeleted = 0 AND ah.is_deleted = 0 AND ah.hunter_id = 83 AND adr.post_nameE '%杰%' HAVING recruitPerons LIKE CONCAT('
%', ?, '%')
提示找不到recruitPersons这个列,这是什么原因呢?

  • 写回答

6条回答

      报告相同问题?

      相关推荐 更多相似问题

      悬赏问题

      • ¥15 session失效问题
      • ¥15 GMS地下水数值模拟无法打开
      • ¥15 树型结构的数据怎么匹配分支
      • ¥15 stm32F4用.引不出来结构体成员怎么解决
      • ¥15 .exe文件打不开怎么解决?
      • ¥30 Syntax Error: TypeError: this.getOptions is not a function的问题
      • ¥15 eclipse Android环境搭建
      • ¥15 unity中脚本之间的继承有什么作用
      • ¥15 C语言内存对齐代码不太理解
      • ¥15 uniapp中的uni-file-picker组件多图上传,删除,显示。以及C#.Net后端处理问题