======================================================================= SQL Statements ======================================================================= Old Statement: SELECT COUNT(DISTINCT RES.ID_) FROM ACT_RU_JOB RES WHERE RES.SUSPENSION_STATE_ = 1 ---------------------------------------------- New Statement PostgreSQL: SELECT COUNT(*) FROM ( SELECT DISTINCT RES.ID_ FROM ACT_RU_JOB RES WHERE RES.SUSPENSION_STATE_ = 1) ======================================================================= new Properties (in DbSqlSessionFactory.java) ======================================================================= PostgreSQL: countDistinctBeforeStart="SELECT COUNT(*) FROM (SELECT DISTINCT" countDistinctBeforeEnd="" countDistinctAfter=")" Others: countDistinctBeforeStart="select count(distinct" countDistinctBeforeEnd=")" countDistinctAfter="" ======================================================================= MyBatis Mapper ======================================================================= Old Statement in Job.xml: ---------------------------------------------- New Statement in Job.xml: