Oracle Database SQL single-row functions-date functionsPrefaceThe date functions of the Oracle database are very powerful and relatively large. I will sort it out for future reference.. Convenience for yourself and convenience for others!Common
During development, you often need to write an SQL statement to insert information into the table. If the inserted data field is of the date type, you must convert the date type to the string type and insert it into the database using SQL statements. This is the only method of my field. If you have any questions, pleas
SQL format execution sequence of oracle data structure and sequence number of SQL query processing, oraclesql
I. execution sequence of SQL format
FROM-> WHERE-> group by-> HAVING-> SELECT-> ORDER
1. The from clause assembles data
('05 13:48:22. 1234567890 ', 'dd HH24: MI: SS. ff10') from dual*ERROR at line 1:ORA-01821: date format not recognized3. The date function can only represent a date, not a time. The following is an example of an application in 4.
Default Value: Year in SYSDATE; month: Month
oracle| Solution | data
CREATE TABLE Worklog_a (Man_bar CHAR (8) Not NULL,Man_name VARCHAR2 is not NULL,MAN_DEP VARCHAR2 () not NULL,Log_time Date not NULLStatus VARCHAR2 (40));CREATE Unique INDEX Worklog_a_indexOn Workman (Man_bar,man_name);Comment on table worklog_a is' Log on to the diary list ';
sql:= ' Select Man_bar as "attendance bar code", Man_name as "n
Three database date conversions comparison:http://blog.csdn.net/zljjava/article/details/17552741SQL type conversion function: Cast (type1 as Type2)Date types in the database SQL SERVERDATE 1970-01-01DATETIME 1970-01-01 00:00:00OracleDATE 2015-08-07 17:34:37TIMESTAMP 1970-01-01 00:00:00.000000 is the extended type of date
In this article, the date obtained by getdate () is composed of two parts: today's date and then time: Select getdate ()
Use datename () to obtain the corresponding year, month, and day, and then connect them:
Select datename (year, getdate () + '-' + datename
(Month, getdate () + '-' + datename (day, getdate ())
In addition, datename () can also be used to obtain the hour, time, second, day of week, and we
Oracle Function Synthesis small example date operation premise there is a student table student contains a birthday field (Date Field) let you find a student over 10 years old. Here, we only use the year to judge the difference between the birthday and the current date. Firs
Ext.: http://chwshuang.iteye.com/blog/933926In development, it is often necessary to write a SQL statement to insert information into a table, insert the data if the field is a date type, you must convert the date type to a string literal in the SQL statement to insert the database. This is the only method of my field,
1, Oracle date in the internal representation is numeric format, precision from century to seconds.2. The default date representation format is DD-MON-RR (not yy)The difference between YY and RR:3. Date Operation functionExample:T
When I was writing a stored procedure, I used the start time and end time to create a view. So I wrote a process like this:
Procedure prc_CreateViewOBookTcert (p_startdate in date, -- start date of statisticsP_enddate in date) -- end date of statisticsIsV_ SQL varchar2 (2000
, or 25thDatePart (' y ', ' 2005-7-25 22:56:32 ') returns a value of 206 that is the No. 206 Day of the YearDatePart (' yyyy ', ' 2005-7-25 22:56:32 ') returns a value of 2005 that is 2005The SQL Server DATEPART () function returns a portion of the SQL Server datetime field.The syntax for the SQL Server DATEPART () function is:DATEPART (Portion, datetime)where da
SQL Server and Oracle acquisition time and date difference1. Get System Current TimeSQL Server 2005:
Select GETDATE ()
The GETDATE () function returns the current time and date from SQL Server.
GrammarGETDATE () instanceExample 1Use the following SELECT statement:
Select
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.