-- Select deptno, count (1), sum (count (1) over (order by deptno DESC rows between unbounded preceding and unbounded following) as AAA, sum (count (1) over () as AAAA from EMP group by deptno; -- select empno, Sal, rank () over (order by Sal DESC)
Document directory
Create an index for an appropriate Oracle Database
Creating an index for an appropriate Oracle Database in an Oracle database is simple. However, it is difficult to create an index reasonably. I believe that three appropriate
OracleThe keyword used in MSSQL similar to top is rownumber. The usage is as follows:
Select firmcode, balance from (
Select
Rownum
RN, T. firmcode, T. Balance
From firmbalance_tab
A data synchronization function is required in the recent project to regularly synchronize the information in a database to another database. In this way, the storage process trigger timer and dblink are used.
I have never written about the storage
Group and sort multiple data and obtain the first record in each group.
SQL code
Select *
From (select row_number () over (partition by order by DESC) lev,
.*
From )
Where lev_= 1
Order by DESC
Select *
From (select row_number () over
Create and manage multiple database instances in Oracle1007 people read comments (0) collect reports
1. After the database assist or create database statement is used, the system prompts that the database already exists.
2. Create with database
Address: http://tech.sina.com.cn/s/2008-09-05/0907794823.shtml
The greatest difference between an SQL Server database and an Oracle database is the tablespace design. Oracle Database pioneered the design concept of tablespace, which makes an
The storage hierarchy in Oracle is as follows:
(1) A database consists of one or more tablespaces.
(2) A tablespace consists of one or more data files. These files can be cooked files in the file system, original partitions, database files managed
1. Oracle System ArchitectureUnlike other database products, Oracle has its own unique system architecture. The Oracle system architecture is the framework of the entire ORACLE Server System and the basis and core for managing and applying ORACLE
Summary of rownum usage in Oracle!For the rownum problem in Oracle, many documents do not support>, >=, =, between... and. The preceding symbols can only be used (,> =, =, .. and will prompt SQL syntax errors, but often cannot find a record, and it
In Oracle, an application of row and column Conversion
The table structure is omitted. The SQL statement is as follows:
select z.* from (select row_number() over(order by bs_cnt desc) rn, inn2.* from (select distinct sum(bv_sum) over(partition by
First_value and last_value: return the first and last values of the specified column.
Syntactically, there are differences between 9i and 10g:
9i:
FIRST_VALUE ( expr ) OVER ( analytic_clause )
10g:
FIRST_VALUE (expr [ IGNORE NULLS ]) OVER
CREATE DATABASE LINK
-- Create a link (created in the target database) Create [public] database link linknameconnect to username identified by passwordusing 'connectstring '; -- create public database link database connection name connect to user
The lag and lead analysis functions can retrieve the data of the first n rows of the same field (Lag) and the data of the last n rows (LEAD) as independent columns in the same query.
This operation can replace table self-join, and lag and lead have
1. Explain the differences between cold backup and hot backup and their respective advantagesAnswer: Hot Backup is applicable to databases in the archive mode. When the database is still in the working state, it is backed up. Cold backup refers to
Get table:Select table_name from user_tables; // The table of the current userSelect table_name from all_tables; // tables of all usersSelect table_name from dba_tables; // includes the system tableSelect table_name from dba_tables where owner =
1./* + all_rows */It indicates that the overhead-based optimization method is selected for the statement block, and the optimal throughput is obtained to minimize the resource consumption.For example:Select/* + all + _ rows */emp_no, emp_nam, dat_in
1. Set the initialization parameter job_queue_processes.SQL> alter system set job_queue_processes = N; (n> 0)Job_queue_processes: the maximum value is 1000. View the Job Queue background processSQL> select name, description from V $ bgprocess; 2.
1. Advantages of exceptions If no exception exists, check whether each command succeeds or fails in the program, as shown in figureBeginSelect...-- Check for 'no data found 'ErrorSelect...-- Check for 'no data found 'ErrorSelect...-- Check for 'no
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service