左oracle → → → → 右mysql
1、当前时间问题:TRUNC( SYSDATE )------→ → → →-----------date_format(NOW())
2、列转行函数:LISTAGG(csa.LABLE_NAME,',') WITHIN GROUP (ORDER BY csa.LABLE_NAME) lableName--------→ → → →--------------GROUP_CONCAT(csa.LABLE_NAME,',') lableName
3.非空排序:select * from (select * from STUDENT WHERE ID=#{Id} order by PUSH_TIME desc nulls last ) where rownum = 1 (其中 desc nulls last有区别,rownum = 1有区别) --------→ → → →-------------- order by IF(ISNULL(PUSH_TIME),1,0),PUSH_TIME DESC ) t LIMIT 1 --ROWNUM是一个序列,是oracle数据库从数据文件或缓冲区中读取数据的顺序。它取得第一条记录则rownum值为1,第二条为2,依次类推
4、非空排序:ORDER BY t1.UPDATE_TIME desc nulls last --------→ → → →-------------- order by IF(ISNULL(t1.UPDATE_TIME),1,0),t1.UPDATE_TIME DESC;