to_date(?, 'YYYY-MM-DD HH24:MI:SS')"
STR_TO_DATE('2003-15-10 00:00:00','%Y-%m-%d %H:%i:%s');???? //格式不對,會返回NULL
to_char(create_time,'yyyy-MM-dd')
DATE_FORMAT(create_time,'%Y-%m-%d')
sysdate
now()或者CURRENT_TIMESTAMP?//'1997-12-15 23:50:26',建表的時(shí)候,timestamp類型可以指定default CURRENT_TIMESTAMP
sysdate - 7?? //7天前
now()-INTERVAL 7 DAY??
select * from (select .... where rownum<end) where rownum>start
limit [start,] length
substr(productInfor,1,20)
SUBSTRING('Quadratically',5,6)???? //SUBSTRING(str,pos,len)
instr(str,substr,pos,index)
instr(str,substr) 或者 locate(substr,str,pos)
// 沒有相對應(yīng)的語法,但一般情況,這個(gè)是和substr結(jié)合起來用的。
//如果是str="2005-10-01"取中間的10這樣的需要,oracle是substr(str,instr(str,'-',1,1)+1,instr(str,'-',1,2)-instr(str,'-',1,1)-1)
那在mysql里面,可以試試這樣SUBSTRING_INDEX(SUBSTRING_INDEX(str,'-',2),'-',-1),意思就是取第二個(gè)-之前的str后(2005-10),再取倒數(shù)第一個(gè)-之后的內(nèi)容
oracle的nvl(ss,dd)函數(shù)在mysql中怎么實(shí)現(xiàn)?
答:ifnull(ss,dd)