1、mysql 支持 select 不在 group by 出现过的字段,dm 默认不支持

方式一:就要在 select 后面加上

/*+ GROUP_OPT_FLAG(1)*/
select /*+ GROUP_OPT_FLAG(1)*/ sys_role.* from sys_role , sys_role_menu group by sys_role.id

方式二:在 dm.ini 修改配置参数,重启

COMPATIBLE_MODE = 4

2、mysql 支持 group by 和后面跟着排序合并,dm 不支持

比如:

select * from student group by class_no asc

mysql 下能执行,dm 会报错

dm 要拆开

select * from student group by class_no order by class_no asc

3、dm 的 inner join 要写 on

4、dm 没有 date(xxx)函数,要用 to_date(xxx, 'YYYY-MM-DD') 代替

5、dm 没有 group_concat,用 listagg 替代

mysql 的 group_concat 默认使用逗号拼接,dm 的 listagg 默认直接拼接,要手动指定用逗号拼接

mysql:
select group_concat(sid) as s from student group by class_no

dm:
select listagg(sid, ',') as s from student group by class_no