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)
阅读(2058) | 评论(0) | 转发(0) |