(except CHR) and return the character value. In addition to the special instructions, most of these functions return a numeric value of type VARCHAR2. The return type of a character function is subject to the same restrictions as the base database type, such as: The VARCHAR2 value is limited to 2000 characters (4000 characters in ORACLE 8), and the char value is limited to 255 characters (2000 in ORACLE8).
Oracle date functions:
Months_between: returns the difference of the month between two dates months_between ('01-EP-95 ', '11-Jan-94') ==> 19.6774194 add_months: Number of copies added to the date. add_months ('11-Jan-94 ', 6) ==> '11-JUL-94' next_day: Specifies the day after the date. next_day ('01-SEP-95 ', 'Friday') ==> '08-SEP-95' last_day: the last day of the month. last_day ('01-SEP-95) ==> '30-SEP-9
information technology Select Replace (deptno, ' 01 ', ' information technology ') from users;
Use the Age field in the Employee Information table with 10 to select mod (age,10) from users;
Year of entry of employee: Select Extract (from RegDate) from users;
Find employee information for May entry select * from Users where extract (month from regdate) = 5; Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced. Numerical
Common Oracle functions-character and mathematical functions, oracle mathematical functions
Various functions are often used in the development and use of oracle. This chapter summarize
Common Oracle functions-date functions, oracle date functions
In the development and use of oracle, a variety of date functions are often used. The online date
string in Java?---java and string concatenation, it really spelled a null---package Oracle;--public class Demo {--public static void main (String[]args) {--String Str=null;--System.out.println ("str:" +STR);--}--}--->str:null---and numeric operations, the result is still nu
Oracle InStr functions
For the InStr function, we often use this: to find the position of a specified substring from a string. For example:
Sql> Select InStr (' Oracle ', ' or ') position from dual;
POSITION
----------
1
Starts at the first position of the
space. See RPAD.
128
129 select LPAD (answer, 7, '') padded, answer unpadded from question;
130
131 PADDED UNPADDED
132
133Yes Yes
134NO NO
135 Maybe maybe
136
137
138 LTRIM (,)
13
[1] [2] [3] [4] Next page
The ORACLE tutorial is: OraclePL/SQL single-row functions and group functions. 9 remove the leftmost character f
, ') Padded,answer unpadded from question;
130
131PADDED unpadded
132
133Yes Yes
134NO NO
135Maybe maybe
136
137
138 LTRIM (,)
13
[1] [2] [3] [4] Next pageThe Oracle tutorials being looked at are: Oraclepl/sql single-line functions and group functions. 9 Remove the leftmost character in the C1, so that the first chara
Yes134NO NO135 Maybe maybe136137138 LTRIM (,)13
[1] [2] [3] [4] Next pageThe ORACLE tutorial is: OraclePL/SQL single-row functions and group functions. 9 remove the leftmost character from c1 so that the first character is not in c2. If there is no c2 character, c1 will not change.
140
141 select LTRIM ('Mississippi '
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-> AngleR
capacity is generally designed based on three times the number of Chinese characters.
(4) nvarchar type
The Nvarchar2 type solves the problem of varchar2 in Chinese. nvarchar (2) can only store up to two characters regardless of Chinese or English characters.
2.2-character processing functions
(1) trim, ltrim, and rtrim remove spaces from the string header or tail.
(2) lpad: The rpad function defaults to a
SQL advanced (1) -- regular functions, SQL -- Functions
When we compare and process strings, the like clause may be used at most. % Represents one or more characters, and _ represents one character. However, when processing complex strings, we find that this is far from what we need. So this low-end, not beautiful stat
(char_expr, expression)Returns the starting position of the specified char_expr; otherwise, it is 0.Patindex ("% pattern %", expression)Returns the starting position of the specified style. Otherwise, the value is 0. Datalength is used to determine the length of a variable string.Soundex is used to determine whether a string has similar pronunciation.Difference returns the value 0-4. 0 indicates the least similarity, and 4 indicates the most simila
Methods for Oracle Connection stringsMethod One: Wmsys.wm_concat (column)Description: Its function was introduced in Oracle 10g, in the 10g version, the string type is returned, and the CLOB type is returned in the 11g version. The arguments inside the parentheses are columns, and can be a collection of multiple columns, meaning that the ' | | ' is freely availab
Seven common Oracle functions and seven oracle Functions
1. decode Function
Select id, NAME, DECODE (LEVER, 1, 'Professor ', 2, 'associate Professor', 3, 'mentor ', 'lecturer') POSITION, (select classnum from class t where t. NUM = S. NUM) num from teacher s where t. lever in (1, 2, 3 );
The usage logic of the decode
Tags: no character format nbsp sysdate start Ceil Special examplesAbout several Oracle functions that handle the number of decimal places ()1. Rounding of several decimalsSelect Round (1.2345, 3) from dual;Results: 1.2352. Reserved two decimal places, onlySelect Trunc (1.2345, 2) from dual;Results: 1.23 Select Trunc (1.2399, 2) from dual; Results: 1.233. Take an integerReturns the largest integer greater th
Introduction to Oracle System Variable Functions and oracle Variable Functions
Oracle functions are diverse, and system variable functions are one of them. The following describes the t
function | An explanatory function is a program that has 0 or more parameters and has a return value. In SQL, Oracle builds a series of functions that can be called SQL or PL/SQL statements, and functions fall into two main catego
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.