PL/SQL single-line functions and group functionsA function is a program that has 0 or more parameters and has a return value. Oracle has built a series of functions in SQL, which can be called SQL or PL/
Label:String Functions1. Case conversion--upper converted to uppercase--lower convert to lowercase select upper (' AsaR ') 2. Length--len number of words--datalength bytes 3. Space before and after removal-- RTrim Remove the right space--ltrim remove the left Space 4. String intercept--left (' string ', 15) intercept 15 bytes from the left--right (' string ', 15)
I. oracle basic SQL statements and functions, and oraclesql Functions
I. Data Definition Language (ddl)
Data definition language (ddl) is used to change the database structure, including creating, changing, and deleting database objects.
The Data Definition Language commands used to manipulate the table structure inclu
, here we can do this: 1 declare @t varchar (ten);
2 print @t;
3
4 set @t=isnull (@t, ') + ' world ';
5 Print @t
6 The result is: String Handling Functions (1) Substring substring. For example: The name of the product is too long, we may need to intercept the main information. The following part of the product is intercepted, that is, substring ("string
) function: Returns a string that replaces each character in the appearing from_str with the corresponding character in To_str.Translate is a superset of the functionality provided by replace. If FROM_STR is longer than TO_STR, the characters in From_str and not in To_str are removed from the string because they do not have the corresponding substitution characters. To_str cannot be empty.
SQL single-row functions in Oracle databases-continued character FunctionsI practiced some character functions in the previous blog, and then I went to the next blog to read the relevant materials.The character function has not been practiced yet. This time, we mainly perform some supplementary exercises on some unused
Oracle pl/SQL common functions, oracleplsql Functions
On csdn, I also saw a post called Oracle common function 110. after a rough look, there are many data calculations, such as covariance. I don't think I have used much. I can see it today, but it is not very comprehensive.
Character function--return character valueThese functions all receive parameters of the character family type (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
: Procedural and SQL statements.
13. TRANSLATESyntax: TRANSLATE (string, from_str, to_str)
Function: REPLACE each character in from_str with the corresponding character in to_str and then string. TRANSLATE Is a superset of the functions provided by REPLACE.
If from_str is longer than to_str, characters not included in
],c3]) "function" converts a string X to a numeric type "parameter" c2,c3, character type, reference To_char () "Return" number string "reverse" to_char (DATE[[,C2],C3]) "Example" SelectTo_number ('199912'), To_number ('450.05') fromdual; To_multi_byte (C1) "function" converts half-width in a string to full-width "parameter" C1, character "return"
few weeks of each yearTo_char (sysdate, ' mm ') the first few months of each yearTo_char (sysdate, ' Q ') the first quarter of each yearTo_char (sysdate, ' yyyy ') yearSql> Select To_char (sysdate, ' PM yyyy-mm-dd hh24:mi:sssss AD year Mon day ddd iws ') from DUAL;To_char (sysdate, ' Pmyyyy-mm-ddh--------------------------------------------------------------------------------Morning 2008-03-27 09:58:35917 A.D. thousand eight March Thu 087 13Sql> SELECT to_char (Systimestamp, ' HH24:MI:SS. FF5 '
SQL date functions
-- DATEADD-- Returns a new datetime value based on a specified date.-- DATEADD (datepart, number, date)-- Abbreviation of date-- Year yy, yyyy-- Quarter qq, q-- Month mm, m-- Dayofyear dy, y-- Day dd, d-- Week wk, ww-- Hour hh-- Minute mi, n-- Second ss, s-- Millisecond MSSELECT dateadd (mm, 5, '2014/1/8080') as date -- DATEADD-- Returns a new datetime value based on a specified date.-- D
We all know that Oracle functions are widely used in practical applications and are quite familiar with their actual operations and related functions, but do you know how Oracle functions can replace strings with lower-case formats? If you are interested, you can browse the
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 date functions1. Sysdate: curr
data type is a string with a side length (varchar is synonymous with VARCHAR2). 2, string processing functions 2.1. Overview
See table below:
2.2, Connectors | | and concat function
You can connect two column names or constants.
Like what:
SELECT firstname| | LastName from USER;
If the name is good in Chinese, but if it is in English, so the connection will make
Mathematical functions of Oracle SQL functionsABS (x) "function" returns the absolute value of x "parameter" x, numeric Expression "return" numeric SQL> SELECT ABS ( -), ABS (- -) from DUAL; ABS ( -) ABS (- -)---------- ---------- - -Sign (x) "function" returns the positive negative value of X "parameter" x, nu
Methods for Oracle to implement String concatenation and separation functions (WM_CONCAT function), oraclewm_concat
String Aggregation Techniques, or assemble the handler of each link in the process into a string.
There are multiple methods to implement this function in
Functions in oracle are divided into character functions, number functions, date functions, empty processing functions, conversion functions, and other common
SQL single-row functions in Oracle databases-numeric Functions1. trigonometric FunctionsSIN ASIN SINHCOS ACOS COSHTAN ATAN TANHFor the above trigonometric functions, see the name. Do a continuous exercise [SQL] select sin (2), asin (1), SINH (1) from dual;Select cos (1), ACO
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.