NvlThe format of the NVL function is as follows: NVL (EXPR1,EXPR2)The meaning is: if the first parameter of Oracle is empty then the value of the second parameter is displayed, and if the value of the first parameter is not NULL, the first parameter
SQL UNION operatorThe UNION operator is used to combine the result set of two or more SELECT statements.Note that the SELECT statement inside the UNION must have the same number of columns. The column must also have a similar data type. Also, the
The most common example of a segmented query is the lag and lead statistics functions, which allow the lag and lead functions to fetch the first n rows of the same field and the values of the last n rows in a single query. This can be done using
I. Differences in data types between Oracle database and other databases1, Number: formerly int, Oracle:number: Unqualified, Numbers (3): 3-bit characters, 3 bytes. Number (6,2): 4-bit integer, 2-bit decimal, 6-byte length. English numerals are one
There are two simple examples to illustrate the efficiency issues of "exists" and "in"1) SELECT * from T1 where exists (select 1 from T2 where t1.a=t2.a);When the T1 data volume is small and the T2 data is very large, the query efficiency of T12)
(1The code for the lock table query is in the following form:Select Count(*) fromV$locked_object;Select * fromV$locked_object; (2) to see which table is lockedSelectB.owner,b.object_name, A.session_id,a.locked_mode fromV$locked_object A,dba_objects
Oracle Empty Table Processing:1. Dynamically generate a command to assign segment to empty tables:Sql>select ' ALTER TABLE ' | | table_name| | ' allocate extent; ' from User_tables where num_rows=0;2. In the command window, right-click ' Mark ',
Dbms_random is a package that can generate random numbers or strings. There are two ways to use value () in a packageThe first without parameter returns a numeric value with a 38-bit precision ranging from 0.0 to 1.0, excluding 1.0:The second value
1 /*The default DB instance here is ORCL, creating a permanent tablespace for ORCL, zone custom allocation, and automatic management of segments*/2 CREATEtablespace ORCLTBS01 datafile3 'D:\app\darkdog\oradata\ORCL\ORCLTBS01_1.DBF'SIZE 50M;4 5
2015 first blog, Oracle time period query, comparison of TO_DATE and TO_CHARPreface:During time period query, when TO_DATE is used, including the start date, not the end date;When TO_CHAR is used, the start date or end date can be included. Effect
1
Working principle of ORACLE10G, oracle10g64-bit download
Internal execution of database query statements
Select * from xxx
Procedure
Analysis phase (parse)
1. Does the Shared Pool cache have this statement. If any, directly return results.
2.
Oracle segmented Query
You can view the segmented query examples on the Internet. The LAG and LEAD statistical functions are the most used, the Lag and Lead functions can retrieve the data of the first N rows and the value of the last N rows of the
Eight learning points to help you fully understand Oracle databases
TableSpace
Tablespace:
One tablespace corresponds to multiple data files (physical dbf Files)
Create a tablespace using the syntax and log on to the table using sysdba:
-- Create a
How to Use the Oracle optimizer to get twice the result with half the effort
1. select an appropriate Oracle optimizer
There are three optimizer types in Oracle:
A. RULE (RULE-based) B. COST (COST-based) c. CHOOSE (selectivity ).
Set the default
Methods for completely deleting an Oracle database
Many of my friends only use Oracle to delete the system. However, in many cases, he may find that the next installation page disappears when the system is re-installed, and he may have to reinstall
ORACLE-009: locking stored procedures
Recently, we have encountered a situation where only one process can be executed in a stored procedure, and the last process is executed and then executed. This is similar to thread synchronization in program
Oracle multi-Table queryOracle multi-Table query: one-to-many data is placed in one field.
Select id, zhzxm, fzhzxm, ltrim (max (sys_connect_by_path (xm, ','), ',') xmfrom (select id, zhzxm, fzhzxm, xm, row_number () over (partition by id order by
How to Implement paging in Oracle stored procedures
Paging is used for almost every WEB application. Therefore, it is very important to make it generic and efficient. Based on your own ideas, a paging storage process is created using the stored
Only one entry is left for Oracle to delete duplicate dataSQL statement for querying and deleting duplicate records 1. Search for redundant duplicate records in the Table. duplicate records are based on a single field (Id) select * from table where
Oracle date insertionHow to insert data of the date and time type in Oracle:Create table t (mydate date );SQL> insert into t values (to_date ('2017-1-30 12:20:33 ', 'yyyy-MM-DD HH24: MI: ss '));SQL> select to_char (mydate, 'yyyy-MM-DD HH24: MI: ss')
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.