Chinaunix首页 | 论坛 | 博客
  • 博客访问: 5592727
  • 博文数量: 745
  • 博客积分: 10075
  • 博客等级: 上将
  • 技术积分: 7716
  • 用 户 组: 普通用户
  • 注册时间: 2005-04-29 12:09
文章分类

全部博文(745)

文章存档

2019年(1)

2016年(1)

2010年(31)

2009年(88)

2008年(129)

2007年(155)

2006年(197)

2005年(143)

分类: Oracle

2006-12-26 17:55:04

The DUAL Table
The DUAL table is owned by the user SYS and can be accessed by all users. It contains one column. DUMMY, and one row with the value X. The DUAL table is useful when you want to return a value once only: for instance, the value of a constant,
pseudocolumn, or expression that is not derived from a table with user data. The DUAL table is generally used for SELECT clause syntax completeness, because both SELECT and FROM clauses are mandatory, and several calcuations do not need to select from actual tables.
 
The SYSDATE Function
SYSDATE is a date function that returns the current database server date and time. You can use SYSDATE just as you would use any other column name. For example, you can display the current date by selecting SYSDATE from a table. It is customary to
select SYSDATE from a dummy table called DUAL.
 
Date Format Elements:Time Formats
Element              Description
AM or PM             Meridian indicator
A.M. or P.M.         Meridian indicator with periods
HH or HH12 or HH24   Hour of day, or hour(1-12),or hour(0-23)
MI                   Minute(0-59)
SS                   Second(0-59)
SSSSS                Seconds past midnight(0-86399)
Specifying Suffixes to influence Number Display
Element              Description
TH                   Ordinal number(for example, DDTH for 4TH)
SP                   Spelled-out number(for example, DDSP for FOUR)
SPTH or THSP         Spelled-out ordinal numbers(for example, DDSPTH for FOURTH)
阅读(2018) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~