1、PostgreSQL迁移到dmdb——之等效替换FILTER问题
1.1、PostgreSQL的sql
count(*) filter(
where
"archivestate" = '待整理'
and "sjdqzt" = '待整理'
) as "count_unfiled"
1.2、替换方案
SUM(CASE WHEN "archivestate" = '待整理'
AND "sjdqzt" = '待整理' THEN 1 ELSE 0 END) AS "count_unfiled"
2、PostgreSQL迁移到dmdb——之等效替换extract问题
2.1、PostgreSQL的sql
select extract(epoch from SYSDATE)
2.2、替换方案
select UNIX_TIMESTAMP(SYSDATE)
3、PostgreSQL迁移到dmdb——之等效替换STRPOS问题
3.1、PostgreSQL的sql
select strpos('1q3','q3')
3.2、替换方案
select INSTR('1q3','q3')
4、PostgreSQL迁移到dmdb——之等效替换STRING_AGG 问题
4.1、PostgreSQL的sql
STRING_AGG (D.LABEL,
','order by
d.sort )
4.2、替换方案
listagg(
D.LABEL,
','
)within group(
order by
d.sort
)