今天一些收获
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
转载于:https://www.cnblogs.com/cquccy/p/10310186.html