欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

mysql数据库迁移greenplum讲解

程序员文章站 2022-05-03 19:40:44
1.locate(a,b)->position(a in b) 2.convert()函数不可以使用 3.ifnull(null,0.00)->COALESCE(n...

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 colaesce()

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)