sql:select b1.batch_id,b1.busi_no,b1.app_code,b1.batch_ver,b1.inter_ver,b1.create_user,b1.create_date,b1.mod_user,b1.mod_date  from  b_batchs_info b1,b_batchs_src b2  where b1.batch_id = b2.batch_id and b1.batch_ver = b2.batch_ver  and b1.inter_ver<>b2.inter_ver and b1.batch_id not in(select batch_id from B_UPDATE_LOCK )  union all 
select b3.batch_id,b3.busi_no,b3.app_code,b3.batch_ver,b3.inter_ver,b3.create_user,b3.create_date,b3.mod_user,b3.mod_date from b_batchs_info b3  where b3.batch_id not in(select batch_id from b_batchs_src)
sql db2客户端运行没错 SQLQuery query = session.createSQLQuery(sql.toString());
    query.setFirstResult((offset - 1) * length);
    query.setMaxResults(length);
    list = query.list();去掉分页这句没错:query.setMaxResults(length); 
加上query.setMaxResults(length); 报错:
could not execute query.....错误码:-421 42826 UNION操作的选择列表中没有提供相同数目的列 求解!