1、auto_increment 转换成SERIAL。
2、concat 转换成 || 。
3、date_format 转换成 to_char。
4、ifnull 转换成 coalesce($1, $2)。
5、PostgreSQL 在 HAVING 子句不能使用别名。
select name, count(*) as score
from mytable
group by name
having score > 10
转换成
select name, count(*) as score
from mytable
group by name
having count(*) > 10