mysql和oracle 不同的地方

今天一些收获
date_format(date,'%Y-%m-%d')  <-->  to_char()
str_to_date(date,'%Y-%m-%d')  <-->   to_date();

select  date_format('2019-02-01','%Y/%m/%d');

select  date_format(now(),'%Y/%m/%d');
select str_to_date('2019-02-01','%Y-%m-%d')

substr  使用方法不同, oracle 从0 开始,  mysql 从1

oracle  nvl <-->  mysql     ifnull(bc.vouchtype,'D') as vouchtype

substr(date_format(adddate(str_to_date(cr.classifydate,'%Y/%m/%d'),interval 1 month),'%Y/%m/%d'),1,7)
substr(to_char(add_months(to_date(cr.classifymonth,'yyyy/MM'),1),'yyyy/MM/dd'),0,7)

oracle 的空和mysql的空不是同样的概念
oracle ''等同于null, mysql '' 不等同于null

posted on 2019-01-23 17:11  子虚乌有  阅读(336)  评论(0编辑  收藏  举报