Single record function in SQL 1. ASCII returns the decimal number corresponding to the specified character; SQLselectascii (A) A, ascii (a) a, ascii (0) zero, ascii () spacefromdual; The AAZEROSPACE------------------------------------659748322.CHR gives the integer, returns the corresponding character; SQLselect
Single record function in SQL 1. ASCII returns the decimal number corresponding to the specified
SQL has many built-in functions that can be used for counting and computation.Syntax of the functionThe syntax for the built-in SQL function is:SELECT function (column) from tableTypes of functionsIn SQL, there are several kinds of basic function types and types. The basic types of
--------------------------------------------------------------------------------Oracle. World typ = 1 Len = 12 characterset = zhs16gbk: W, O, R, L, d
54. empty_blob () and empty_clob ()Both functions are used to initialize fields of the big data type.
55. GreatestReturns the maximum value in a group of expressions, that is, compare the encoding size of characters.SQL> select greatest ('A', 'AB', 'ac') from
This article is not ready to introduce all of the Oracle functions, in the current situation, I do not have this time, need to learn too much, to spend most of the time on learning to use the technical aspects:), so if you are ready to learn all the Oracle functions of friends, or to focus on:
.
Built-in functions
A series of functions provided by ORACLE for executing specific operations.
SQL built-in functions contain one or more parameters and return one value.
SQL built-in functi
Single-record functions in SQL 1. ASCIIReturns the decimal number corresponding to the specified character;SQL> select ascii ('A') A, ascii ('A') A, ascii ('0') zero, ascii ('') space from dual;A ZERO SPACE------------------------------------65 97 48 322. CHRReturns the corresponding characters;SQL> select chr (54740)
the right of the decimal point. The default value of N2 is 0, if N2 is a negative number, it is rounded to the corresponding digit on the left of the decimal point (although the N2 value mentioned in Oracle documents must be an integer, in fact, the judgment here is not rigorous, even if N2 is not an integer, it will also automatically perform processing after the N2 is rounded up. However, we need to pay special attention to other points that must b
', -3) from DUAL;
2, Length (c) Returns the length of the specified string. If
For example: SELECT LENGTH (' A123 ') from DUAL;
Guess what the return value of select LENGTH (') from DUAL;
(iv). Date function (DateTime functions)
In this type of function, the date is returned except for the value returned by the Months_between.
1, Add_months () returns the value after the specified date month +n, n can be any integer.
For example: SELECT add_months
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
Label:*sql optimization based on ORACLE11GR2 reading notes * Third, cursor in OracleThe cursor in Oracle is a vector of SQL parsing and execution in an Oracle database and is a data structure for C (Oracle is written in C). There are two types of cursor in an
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 string ' Oracle ',
Oracle provides us with very rich aggregate functions, such as Sum\avg\max. In addition, we can write our own aggregate functions, of course, custom aggregate functions can also be used as analytic functions.
Custom aggregate
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
Oracle _ Common grouping functions and oracle grouping FunctionsZookeeper
Oracle _ Common grouping Functions① Grouping Function1. max (column): calculates the maximum value, which is not required for the data type. Any data type can be used.2. min (column): calculates the mi
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
Oracle analysis functions (notes), oracle Functions
Analytics functions are new types of functions introduced by oracle Database in 9i and are continuously enhanced in later versions. T
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
single-record functions in SQL
1.ASCII
Returns the decimal number corresponding to the specified character;
Sql> Select ASCII (' a ') a,ascii (' A ') a,ascii (' 0 ') zero,ascii (') space from dual;
A A ZERO space
--------- --------- --------- ---------
65 97 48 32
2.CHR
Give an integer and return the corresponding character;
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
, returns twice times the wage (2*sal), if it is 30, returns 3 times times the wage, if not, then returns half the wageSelect Ename,deptno,sal,Case DeptnoWhen Ten then 1*salWhen 2*salWhen 3*salelse SAL/2Endfrom EMP;②decode:decode (EXPR1,EXPR2,EXPR3,.........)Eg: Judge Deptno, if it is department 10th, returns one-fold pay (1*sal), or 0 if not.Sql>select Ename,deptno,sal,decode (deptno,10,sal,0) from EMP;Eg: to judge Deptno, if it is Department 10th, return one-fold salary (1*sal), return 30 time
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.