Welcome to the Oracle community forum and interact with 2 million technical staff to enter SYSDATE2 -- ◎ to get the current system time 34ex. 5 selectsysdatefromdual; 67sysdate8 ---------- 920-SEP-071011 commonly used Date Format 1213 date format description 14 -------------------------------
Welcome to the Oracle comm
The time range in the 24-hour format is: 0:00:00-23:59:59 ....The time range in the 12-hour format is: 1:00:00-12:59:59 .... 1. Date and character conversion function usage (TO_DATE,TO_CHAR) Select To_char (sysdate, ' Yyyy-mm-dd hh24:mi:ss ') as nowtime from dual; Date converted to stringSelect To_char (sysdate, ' yyyy ') as nowyear from dual; Get the year of th
'--------03-05-0203-05-0903-05-1603-05-2303-05-30If you change where To_char (T.D, ' mm ') = To_char (sysdate, ' mm ') to sysdate-90, you are looking for every Friday date in the first three months of the current month.9.oracle Medium Time operationThe contents are as follows:1, Oracle supports the operation of the date2, the
To_date formatDay:Dd number 12Dy abbreviated FriDay spelled out FridayDdspth spelled out, ordinal twelfthMonth:MM number 03Mon abbreviated MARMonth spelled out MarchYear:YY two digits 98Yyyy four digits 1998
The time range in the 24-hour format is: 0:00:00-23:59:59 ....The time range in the 12-hour format is: 1:00:00-12:59:59 ....
[ZT] Date and ?? Letter ???1.Date and character
Processing date in Oracle
To_date formatDay:Dd number 12Dy abbreviated FriDay spelled out FridayDdspth spelled out, ordinal twelfthMonth:MM number 03Mon abbreviated MARMonth spelled out MarchYear:YY two digits 98Yyyy four digits 1998
The time range in the 24-hour format is: 0:00:00-23:59:59 ....The time range in the 12-hour format is: 1:00:00-12:59:59 ....1.Date
Oracle Data conversion functions are common functions. The following describes the usage of the two Oracle data conversion functions for your reference.
1) TO_CHAR
This function converts the date, time, and value into text. Its main value is to provide display control over t
number as follows:
SQL> select to_char (sysdate, 'yyyy-mm-dd hh24: mi: ss') current_date, (sysdate-to_date ('2017-01-01 ', 'yyyy-mm-dd') * 86400000 current_milli from dual;
CURRENT_DATE CURRENT_MILLI
--------------------------------
14:00:09 1231250409000
Sorry, the last time I wrote this article, I used it only to calculate the number of milliseconds in Oracle and keep it in Oracle. I didn't get t
stores the time period with a month.
INTERVAL Day [(day_precision)] to SECOND [(fractional_seconds_precision)] stores time periods with days, hours, minutes, seconds.
Date function
The to_char (datetime,fmt) date is formatted with a return type of VARCHAR2 . DateTime input Date, FMT represents the format of the
spl>SELECT * FROM empwhere datesBetweenTo_date (' 2007-06-12 10:00:00 ', ' yyyy-mm-dd hh24:mi:ss ')andTo_date (' 2007-06-12 10:00:00 ', ' yyyy-mm-dd hh24:mi:ss ')Oracle uses 0 as the default value when omitting input parameters corresponding to HH, MI, and SS. If the date data entered ignores the time portion, Oracle will set the time, minute, and second portions
There are many date functions in oracle, such:
1,Add_months ()Used to increase or decrease the number of months from a date value.
Date_value: = add_months (date_value, number_of_months)
Example:
SQL> select add_months (sysdate, 12) "Next Year" from dual;
Next Year
----------
April 11-04
SQL> select add_months (sysdate, 112) "Last Year" from dual;
Last Year
-----
contents are as follows:1, Oracle supports the operation of the date2, the date is calculated in days as a unit3, when it is necessary to calculate the value of smaller units, such as seconds, time-based conversion can be4. Pay attention to parentheses when making time conversion, otherwise there will be problems Sql>
, for example:
AMERICAN_AMERICA.US7SCII
JPANESE_JAPAN.JA16EUC
Language indicates the language of the server message.
Territory specifies the date and number format of the server.
Charset
You can also define the NLS_LANG parameter in some subsets:
The default date format of NLS_DATE_FORMAT
Default date language of NLS_DATE_LANGUAGE
The NLS_NUMB
oracle| Function | conversion | String Oracle Common numerical functions, conversion functions, string functions introduced.
numeric function:
Absolute value of ABS (m) m
MoD (M,n) m is the remainder after the n is removed
Power (M,n) m's n-th-side
Round (M[,n]) m rounded to n digits after the decimal point (n defaults
the CLOB type to VARCHAR2 such a type, or BLOB converting to RAW data, if the converted data is larger than the target type, an error will be made.
When you timestamp convert a type to a date type, the fractional seconds part is staged.
From the BINARY_FLOAT conversion to BINARY_DOUBLE be accurate.
BINARY_DOUBLEwhen converting to a BINARY_FLOAT type, the BINARY_ DOUBLE BINARY_FLOAT
1. Why can't I export the data using the
Create_time ,
It may be that the date in your pipedate field contains hours, minutes, and seconds.To_date ('1970-08-19 ', 'yyyy-mm-dd') = '1970-08-19 00:00:00'So there is no record.
That is, your 12:01:12 is bigger than your conversion.
Solution 1: Get 20120401
Method 2: create_time Hh24: MI: ss') and... And...Same.
Method 3: Use to_char
Select a. mobile_no, A. else
When the to_date conversion time of a string without the time and minute is compared with the date field with the time and second (gt;, lt;,), because the string does not contain the time
When the to_date conversion time of a string without the time and second is compared with the date field with the time and second (g
In large database management systems, Oracle databases are beyond review in terms of database management capabilities and security. Chinese enterprises also use many Oracle databases, but the character sets of different Oracle versions bring a lot of trouble to data display, data backup, data conversion, and other prac
In Oracle date usage, the formats of the parameters _ date ("string to be converted", "format to be converted") must match with each other. Otherwise, an error is reported. For this question, the following articles provide relevant solutions, and hope you will gain some benefits.
That is, the first parameter is interpreted according to the format of the second pa
],c3]) "function" converts a string X to a numeric type "parameter" c2,c3, character type, reference To_char () "Return" number string "reverse" to_char (DATE[[,C2],C3]) "Example" SelectTo_number ('199912'), To_number ('450.05') fromdual; To_multi_byte (C1) "function" converts half-width in a string to full-width "parameter" C1, character "return" string "Example" SQL>SelectTo_multi_byte ('High A') text fromdual; test--High A To_single_byte (C1) "func
according to the given requirements. If fmt = 'mi ', it indicates that the minute is retained and the second is truncated.SQL> select to_char (trunc (sysdate, 'hh'), 'yyyy. mm. dd hh24: mi: ss') hh,2 to_char (trunc (sysdate, 'mi'), 'yyyy. mm. dd hh24: mi: ss') hhmm from dual;HH HHMM--------------------------------------2004.05.09 11:00:00 2004.05.09 11:17:0042. CHARTOROWIDConvert character data type to ROWID typeSQL> select rowid, rowidtochar (rowid), ename from scott. emp;Rowid rowidtochar (RO
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.