日期:2014-05-16 浏览次数:20920 次
1.类型转换 ????
--Oracle??select?to_number('123')?from?dual;??--123;??
?select?to_char(33)?from?dual;???????--33;??
select?to_date('2004-11-27','yyyy/mm/dd')?from?dual;--2004-11-27????
--Mysql??select?cast('123'?as?signed?integer);???--123???
select?cast(33?as?char(2));?????--33;??
select?to_days('2000-01-01');???????--730485????
--SqlServer???select?cast('123'?as?decimal(30,2));????
--123.00??select?cast(33?as?char(2));?????--33;??
select?convert(varchar(12)?,?getdate(),?120) ???
?2.四舍五入函数区别? ????
--Oracle??select?round(12.86*10)/10?from?dual;????--12.9????
--Mysql??select?format(12.89,1);?????????--12.9????
?--SqlServer??select?round(12.89,1);??????????--12.9?????
3.日期时间函数 ????
--Oracle??select?sysdate?from?dual;???????--日期时间?????
--Mysql??select?sysdate();???????????--日期时间???
select?current_date();??????????--日期????
--SqlServer??select?getdate();???????????