1.locate(a,b)->position(a in b)
2.convert()函数不可以使用
3.ifnull(null,0.00)->COALESCE(null,0.00)
4.timestampadd(hour,24,jysj)->jysj::timestamp+'24 hour'
5.substr()->substring()
6.from_unixtime(unix_timestamp(jysj,'yyyy-MM-dd'))->to_date(jysj,'yyyy-MM-dd')
7.year(jysj)->to_char(jysj,'yyyy')
8.concat(cast(cast(nf as char),'年',jd))->nf||'年'||jd as name
9.substr(from_unix_timestamp(jysj),1,$sjd$)->substring(jysj,1,$sjd$)
10.instr(a,b)->position(a in b)
11.if(a=0,1,2)->case when a=0 then 1 else 2 end
12.if(isnull(jyye),0,jyye)->case jyye when coalesce()
13.isnull(null,0.00)->COALESCE(null,0.00)jyye then 0 else jyye end as jyye
14.date_format(jysj,'%y-%m-%d')->to_date(jysj,'yyyy-MM-dd')
15.left(jyzjhm,4)->substring(jyzjhm from 0 for 4)
16.日期函数 字符串函数
18.insertselect 对于select中的字段有顺序要求,且字段不可以少,必须对应。
19.unix_timestamp(不带引号)->to_timestamp(不带引号)
20.postgresql中没有四舍五入->可以使用cast(a as numeric)来替代round()
21.data_format(jysj,'%Y-%m')->to_date(jysj,'yyyy-MM')
22.date_add(jysj,interval 1 day) ->jysj + interval '1 day'
23.abs(round(unix_stamp(a.jysj)-unix_timestamp(b.jysj))) <$max_sjc$->
a.jysj>b.jysj and b.jysj + interval '$max_sjc$ second' < a.jysj
24.isnull(a)->a is null
25.(@rownum:=@rownum+1) -> row_number() over (order by jzje)
26.if(@pjyhm=t2,@rank:=@rank+1,@rank:=1)->row_number() over(partition by t1.jyhm order by t1.交易总金额 desc)
27.if(@pjyhm=t2.jymc,@rank:=@rank+1,@rank:=1)->row_number() over (partition by t1.jyhm order by t1.$pxfs$ desc)
28.ratio_to_report(sum(je)) over (partition by param desc) ->je/sum(je) over (partition by param desc)
29.postgresql division by zero-》case when a=0 then null else b/a end as name
30.case when mm='a' then sum(fyhj) else 0 end mr ->如果有group by必须出现mm
31.postgresql不支持返回id
32.5.3比较4.6来说sql中比较varying<=interger更为苛刻
33.to_date(createddate,'YYYY-MM-DD')->to_date(createddate::text,'YYYY-MM-DD')
34.to_char(timestamp,'yyyy-MM-dd HH24;MI:SS')
35.decode()->case when then else end