SQLServer 2005 和Oracle 语法的一点差异小结
更新时间:2011年04月15日 01:05:34 作者:
Microsoft SQL Server 和Oracle 语法的一点差异小结,需要的朋友可以参考下。
1.获取系统当前时间
SQL Server 2005:
select getdate()
Oracle:
select sysdate from dual
2.获取年月日
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 周中的星期几
SQL Server 2005:
select getdate()
Oracle:
select sysdate from dual
2.获取年月日
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 周中的星期几
相关文章
Windows10 下 Neo4j1.5.8 保姆级安装教程
Neo4j 是一个高性能的、NOSQL 图形数据库,它将结构化数据存储在网络上而不是表中,这篇文章主要介绍了Windows10下Neo4j1.5.8安装教程,需要的朋友可以参考下2023-07-07


最新评论