Label:http://blog.csdn.net/yjp198713/article/details/18131871 Oracle for two minutes and hours of direct point-in-time1, obtain the time difference millisecond number: Select Ceil ((to_date (' 2008-05-02 00:00:00 ', ' yyyy-mm-dd hh24-mi-ss ')-to_date (' 2008-04-30 23:59:59 ', ' Yyyy-mm-dd hh24- Mi-ss ') * 24 * 60 * 60 * 1000) difference between Hao seconds from DUAL;Number of seconds of difference----------
p.rn between and 20;-High efficiencySELECT * FROM (select RowNum rn, d.* from Djdriver D where rownumInclude sort:--Sorting + interval query 1 (Low efficiency)SELECT * FROM (select RowNum rn, t.* from (select d.* to Djdriver D order by djdriver_drivertimes) T) p where p.rnSELECT * FROM (select RowNum rn, t.* from (select d.* to Djdriver D order by djdriver_drivertimes) T) p where P.rn Betwe En 20;--Sorting + interval query 2 (High efficiency)SELECT * FROM (select RowNum rn, t.* from (select d.*
Date and Time script library method list Date. prototype. isLeapYear judge leap year
Date. prototype. Format
Date. prototype. DateAdd Date calculation
Date. prototype. DateDiff compare Date difference
Date. prototype. toString Date to string
Date. prototype. toArray Date is split into Arrays
Date. prototype. DatePart obtains part of the Date information.
Date. prototype. MaxDayOfDate indicates the maximum number of days in the month where the Date is located.
Date. prototype. WeekNumOfYear deter
. tostring date to stringDate. Prototype. toarray date is split into ArraysDate. Prototype. datepart obtains part of the date information.Date. Prototype. maxdayofdate indicates the maximum number of days in the month where the date is located.Date. Prototype. weeknumofyear determine the week of the year where the date is locatedStringtodate string to date typeIsvaliddate verification date validityCheckdatetime full Date and Time checkDaysbetween date day difference
JS Code:
//------------------
. prototype. DateAdd Date calculation
Date. prototype. DateDiff compare Date difference
Date. prototype. toString Date to string
Date. prototype. toArray Date is split into Arrays
Date. prototype. DatePart obtains part of the Date information.
Date. prototype. MaxDayOfDate indicates the maximum number of days in the month where the Date is located.
Date. prototype. WeekNumOfYear determine the week of the year where the Date is located
StringToDate string to date type
IsValidDate verification dat
. FormatDate. prototype. DateAdd Date calculationDate. prototype. DateDiff compare Date differenceDate. prototype. toString Date to stringDate. prototype. toArray Date is split into ArraysDate. prototype. DatePart obtains part of the Date information.Date. prototype. MaxDayOfDate indicates the maximum number of days in the month where the Date is located.Date. prototype. WeekNumOfYear determine the week of the year where the Date is locatedStringToDate string to date typeIsValidDate verification
to string
Date. prototype. toArray Date is split into Arrays
Date. prototype. DatePart obtains part of the Date information.
Date. prototype. MaxDayOfDate indicates the maximum number of days in the month where the Date is located.
Date. prototype. WeekNumOfYear determine the week of the year where the Date is located
StringToDate string to date type
IsValidDate verification date validity
CheckDateTime full Date and Time check
DaysBetween date day difference
Copy codeThe Code is as follows ://-
("2007-8-1");DateTime DT2 = Convert.datetime ("2007-8-15");TimeSpan span = dt2. Subtract (DT1);int Daydiff = span. Days + 1;Calculate the number of days of the month in a year-----------------------------------------------int days = Datetime.daysinmonth (2007, 8);days = 31;Add one day to date, one day less-----------------------------------------------DateTime DT =datetime.now;Dt. AddDays (1); Add one dayDt. AddDays (-1);//Decrease One dayOther years method similar ...Convert Date function in O
("2007-8-1");DateTime DT2 = Convert.datetime ("2007-8-15");TimeSpan span = dt2. Subtract (DT1);int Daydiff = span. Days + 1;Calculate the number of days of the month in a year-----------------------------------------------int days = Datetime.daysinmonth (2007, 8);days = 31;Add one day to date, one day less-----------------------------------------------DateTime DT =datetime.now;Dt. AddDays (1); Add one dayDt. AddDays (-1);//Decrease One dayOther years method similar ...Convert Date function in O
. prototype. DateDiff compare Date differenceDate. prototype. toString Date to stringDate. prototype. toArray Date is split into ArraysDate. prototype. DatePart obtains part of the Date information.Date. prototype. MaxDayOfDate indicates the maximum number of days in the month where the Date is located.Date. prototype. WeekNumOfYear determine the week of the year where the Date is locatedStringToDate string to date typeIsValidDate verification date validityCheckDateTime full Date and Time checkD
format the output, contains the information is relatively rich. But sometimes you don't need to get that much information, you just have to care about the number of milliseconds it returns, such as getTime(). In order to get this timestamp, many people also like to use the new date (). GetTime () to get, I see no problem, but in fact there is no need.In fact, look at the Java source code will know: Public Date () {This (System.currenttimemillis ()); }It's already obvious that what new Dat
Select date, optional field 1, 2,sum (Type 1) type 1,sum (Type 2) type 2,sum (Type 3) type 3,sum (Type 4) type 4,sum (Type 5) type 5,sum (type 6) type 6 from (Select To_date (to_char (date, ' Yyyy-mm-dd '), ' yyyy-mm-dd ') date, optional field 1, optional field 2,count (primary key field) type 1,0 type 2,0 type 3,0 type 4,0 types type 6 from Table namewhere 1=1Group BY To_date (To_char (date, '
Tags: script month day Var ima val Order by date Submit JDEstablish an Instance data table to create an order form myorder1111Table Sub-segment: ID number Primary key (the value cannot be heavy, cannot be empty)
name varchar2 ($)
odate Date
Inserting data into a table1, ' jd0001 ', 123.45, sysdate 2, ' jd0002 ', 345.85, sysdate Submit data (Commit) Change the order amount with ID equal to 2 to 2345.68. Date type Introduction (1) The default representation of a date type' Dd-mon-yy '(2)
Oracle calculates the total data from 1 to 12 months in a year (very practical)Case studies
Query the total number of real population from January 2015 to 12 months and the number of real population from January 2014 to 12 months in previous years. The number of months that are not found is 0. Similar results
Create a table
create table PERSONSITUATION( id NUMBER not null, rdate DATE, nums NUMBER)
Insert data
insert into PERSONSITUATION (id, rdate, nums) values (1, to_date('26-01-2015'
SQL Server Date and Time Processing set
When the convert date conversion format is 20 or 120, the resulting string does not contain milliseconds.For example, select convert (varchar (23), getdate (), 120 or 20)21:46:43
When the date conversion format is 21 or 121, the resulting string is in milliseconds.Select convert (varchar (23), getdate (), 121 or 21)21:47:34. 360
Japanese StandardWhen the date conversion format is 111, the resulting string is yyyy
Oracle calculates the total (very useful), oracle1-12 for 1-12 months of a yearCase studies
Query the total number of real population from January 2015 to 12 months and the number of real population from January 2014 to 12 months in previous years. The number of months that are not found is 0. Similar results
Create a table
create table PERSONSITUATION( id NUMBER not null, rdate DATE, nums NUMBER)
Insert data
insert into PERSONSITUATION (id, rdate, nums) values (1, to_date('26-01-2015'
number of the arrays: month and day time and minute (one) Date.prototype.datePart: Obtain date data information *//** * Date legitimacy verification: Determine if the datastr conforms to the date format specified by FORMATSTR * Example: * (1) alert (date.isvalidate (' 2008-02-29 ', ' yyyy-mm-dd '));//true * (2) alert (date.isvalidate (' aaaa-58-29 ', ' yyyy-mm-dd '));//false * Datestr: Required, Date Strin
Scenario: Encountered 100 million data volume data needs to do some statistical analysis according to the user name, want to do some aggregation calculation is basically not possible, so the intention is to create a partition according to the date by year, and then the individual partitions are counted, the final summary results.How to do this, create a new partition table, and then extract the source and write the new table with the ETL tool.Create Tabletemp_test (log_id Number( -), user_id
Tags: name FIFO return full current max varchar SYS int 1. Conversion functionThe most significant relationship with the date operation is two conversion functions: To_date (), To_char ()The To_date () function converts a character type to a date type in a certain format:Specific usage: to_date (' 2004-11-27 ', ' yyyy-mm-dd '), the former is a string, the latter is a conversion date format, note, before and after the two to a corresponding.such as; To
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.