MySQL和Oracleb比较

1.查询系统当前时间:
Mysql:

select sysdate() from dual;

Oracle:

select sysdate from dual;

2.查询当前日期
Mysql:

select CURRENT_DATE() as a;

Oracle:

select to_char(sysdate,'YYYY-MM-dd') from dual;

3.查询当前时间
Mysql:

select CURRENT_TIME() as b;

Oracle:

select to_char(sysdate,'hh24-mi-ss')from dual;

4.格式化时间
Mysql:

select DATE_FORMAT('2009-12-25 14:23:31','%Y-%m-%d-%T')

Oracle:

select to_date('2009-12-25 14:23:31','yyyy-mm-dd,hh24:mi:ss') from dual

5.备份数据库命令
Mysql:
备份数据库、表数据

mysqldump -u username -p dbname table1 table2 ...> 路径\filename.sql

恢复数据

mysqldump -u username -p < 路径\filename.sql

你可能感兴趣的:(MySQL,MySQL)