我是一只咸鱼

导航

mysql相似于oracle的to_char() to_date()方法

mysql日期和字符相互转换方法,
date_format(date,'%Y-%m-%d')  -------------->oracle中的to_char();
str_to_date(date,'%Y-%m-%d')    -------------->oracle中的to_date();
sql =     "SELECT *  FROM emp WHERE empno LIKE ? OR ename LIKE ? OR job LIKE ? OR date_format(hiredate,'yyyy-mm-dd') LIKE ? OR sal LIKE ? OR comm LIKE ? limit ?,?" ;

 

posted on 2015-09-11 14:17  我是一只咸鱼  阅读(256)  评论(0编辑  收藏  举报