mysql数据库迁移greenplum讲解
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)
推荐阅读
-
mysql数据库迁移greenplum讲解
-
实例讲解MySQL数据库中文问题的解决方法
-
一个用户迁移数据库前后的性能差异case_MySQL
-
从八个方面来讲解如何全新优化MySQL数据库性能。
-
详细讲解如何用SQLyog来分析MySQL数据库
-
实例讲解MYSQL数据库的查询优化技术_MySQL
-
将MySQL迁移到Microsoft SQL Server 2000 (一)-数据库相关-PHP教程
-
实例讲解MySQL数据库中文问题的解决方法
-
MySQL数据迁移到MSSQL-以小米数据库为例-测试828W最快可达到2分1_MySQL
-
用perl做数据库迁移,从MSSQL到MYSQL(-)大概思路_MySQL