sys. dbms_random.value (0, 1) value from dual;13. Get the symbolS: select sign (-8) value-1O: select sign (-8) value from dual-1---------- Mathematical functions14. Circumference RateS: select pi () value 3.1415926535897931O: Unknown15. sin, cos, and tan parameters are in radians.For example, select sin (PI ()/2) value to get 1 (SQLServer)16. Asin, Acos, Atan, Atan2 return radians17. radian angle Interchange (, Oracle unknown)DEGREES: Radian-> AngleRADIANS: Angle-> radian--------- Comparison of
time difference (in seconds ):
(Days (T1)-days (T2) * 86400 +(Midnight_seconds (T1)-midnight_seconds (T2 ))
For convenience, you can also create SQL user-defined functions in the preceding method:
Create Function secondsdiff (T1 timestamp, T2 timestamp)Returns intReturn ((Days (T1)-days (T2) * 86400 +(Midnight_seconds (T1)-midnight_seconds (T2 )))@
To determine whether a given year is a leap year, t
Record an SQL statement first.Select uid, rank, money, e, from_unixtime (time/1000) from stats_2012_01_19 where comm = 8888 and e> 40 and from_unixtime (time/1000) between '2017-01-19 00:00:00 'and '2017-01-19 01:00:00'Then start to convert .....001MySQL Date and Time Functions002003DAYOFWEEK (date)004The return date i
the time difference (in seconds ):
(Days (T1)-days (T2) * 86400 +(Midnight_seconds (T1)-midnight_seconds (T2 ))
For convenience, you can also create SQL user-defined functions in the preceding method:
Create Function secondsdiff (T1 timestamp, T2 timestamp)Returns intReturn ((Days (T1)-days (T2) * 86400 +(Midnight_seconds (T1)-midnight_seconds (T2 )))@
To determine whether a given year is a leap year, the
) * 86400 +(Midnight_seconds (T1)-midnight_seconds (T2 ))
For convenience, you can also create SQL user-defined functions in the preceding method:
Create Function secondsdiff (T1 timestamp, T2 timestamp)Returns intReturn ((Days (T1)-days (T2) * 86400 +(Midnight_seconds (T1)-midnight_seconds (T2 )))@
To determine whether a given year is a leap year, the following is a useful
convenience, you can also create SQL user-defined functions in the preceding method:Create function secondsdiff (t1 TIMESTAMP, t2 TIMESTAMP)RETURNS INTRETURN ((DAYS (t1)-DAYS (t2) * 86400 +(MIDNIGHT_SECONDS (t1)-MIDNIGHT_SECONDS (t2 )))@To determine whether a given year is a leap year, the following is a useful SQL function. You can create it to determine the nu
It is very inconvenient to process dates in PHP, for example, to find the month of the difference between two dates? What should I do? File name: date. inc. php3 before using these two functions, you must first convert the date or date to the timestamp type. For example: $ todaymktime (, 0,
, day, hour, minute, and second of the difference between the current date and the target date: The code is as follows:Copy code Select datediff (yy, '2017-01-01 14:12:01 ', getdate ())Select datediff (q, '2017-01-01 14:12:01 ', getdate ())Select datediff (m, '2017-01-01 14:12:01 ', getdate ())Select datediff (ww, '2017-01-01 14:12:01 ', getdate ())Select datediff (d,
File name: date. inc. php3 before using these two functions, you must first convert the date or date to the timestamp type. For example: $ todaymktime (0, 0, 0, date (m), date (d), date
The common time format mask is as follows:Mask element meaningYYYY four-digit year (for example, 2005) yearYY two-digit year (for example, 05)Q quarter (1-4)MM month (01-12) monthThe number of weeks in WW (1-53), in which the first week is the first day to the seventh day of the year.The number of weeks in the month of W (1-5), in which the first week is the first day of the month to the seventh dayDay of DDD (1-366)DD Day (1-31)Day of week D (1-7), where Sunday is 1 and Saturday is 7HH24 in 24-
Label:Original: SQL Server function Full solution One: Data type conversion functionWhen you work with values of different data types at the same time, SQL Server typically automatically makes a hermit type conversion. Values that are similar to data types are valid, such as int and float, but for other data types, such as Integer and character types, the Hermit transform cannot be implemented, and the disp
necessary to convert each other, the following gives the conversion of several different ways. One, complete in MySQL This way in the MySQL query statement conversion, the advantage is not to occupy PHP parser parsing time, fast, the disadvantage is only used in database query, there are limitations. 1. UNIX timestamp converted to date function: From_unixtime () General form: Select From_unixtime (1156219870); 2.
The first day (Datefirst) setting determines which day your system uses as the first day of the week. All of the following examples are established in Sunday as the first day of the week, with the first day set to 7. If your first day setting is not the same, you may need to adjust these examples so that it matches the different first-day settings. You can check the first day setting by using the @ @DATEFIRST function.
Let's review the DateDiff and DATEADD
Label: The usual time format masks are as follows:Mask element meaningYYYY four-digit years (e.g. 2005) yearYY Two-digit year (e.g. 05)Q Quarter (1-4)MM month (01-12) monthNumber of weeks of WW years (1-53), of which the first week is the first day of the year to the seventh dayW months of the week (1-5), where the first week is the first day of the month to the seventh dayThe day of the DDD year (1-366)DD Month's Day (1-31)D Week of the Day (1-7), of which Sunday is 1, Saturday is 7 daysHH24 24
SECONDS calculate the number of DAYS between two dates, you can subtract a date, as shown below: days (current date)-days (date ('2017-10-22 ') If you want If the date or time value is connected to other texts, You need to convert the value to a string. To do this, you only need to use the CHAR () function: char (curr
OracleDate type and related functions in
OracleProvides many built-in date types, including the following:DateTimestampTimestamp with Time ZoneTimestamp with local time zoneInterval year to monthInterval day to second
The date type is used to store the date, accurate to seconds. You may set the nls_date_format or to_ch
The ORACLE tutorial is: OraclePL/SQL single-row functions and group functions. A 1 function is a program with zero or multiple parameters and a return value. Oracle has a series of built-in functions in SQL, which can be called SQL
The ORACLE tutorial is: OraclePL/SQL single-row functions and group functions. A 1 function is a program with zero or multiple parameters and a return value. Oracle has a series of built-in functions in SQL, which can be called SQL
"-"? Because convert is formatted here in the time: 2007/05/22It is also particularly important to note that the format of convert is formatted with the previous 0 format, for example, 2007-1-1 12:12:31 the result is:2007-01-01, so be sure to add a leading 0 to the number of months and days in your date that is less than 10 (excluding 10) before your query.For example: 1 should be 01
The specific usage of this number is as follows:
Conversion funct
, otherwise the result returned will contain a fraction.
308
309 New_time (,,)
310 D1 is a date data type that returns the date and time in the time zone tz2 when the date and time in the zone tz1 are d. TZ1 and TZ2 strings.
311
312 Next_day (,)
313 Returns the first day of the condition given by Dow after date D, Dow
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.