- 时间:2020-09-04 01:40 编辑: 来源: 阅读:
- 扫一扫,手机访问
摘要:SQLServer 2005 和Oracle 语法的一点差异小结
[b]1.获取系统当前时间
[/b]SQL Server 2005:
select getdate()
Oracle:
select sysdate from dual
[b]2.获取年月日
[/b]SQL Server 2005:
select year(getdate()) --2011
select month(getdate()) --3
select day(getdate()) --23
Oracle:
select to_char(sysdate,'yyyy') from dual --2011
select to_char(sysdate,'mm') from dual --03
select to_char(sysdate,'dd') from dual --23
q 季度
hh 小时(12)
hh24 小时(24)
mi 分
ss 秒
D 周中的星期几