of 1250 NODE5, then the only node affected is the Node1,node1 storage range changed from [0, 2500] [0, 1250), NODE5 storage range is [1250, 2500), so it needs to be dropped on [1250, 2500) range of data moved to NODE5. It is very important that the others do not need to make changes. Equivalent to NODE5 share part of
)
---------- ---------------------------------------------
10 1
2
3
20 1
2
3
4
4
30 1
2
2
3
4
5
14 rows have been selected.
Time used: 00:00:00.20
Sql> Select Deptno,ename,sal,lag (ename,1,null) over (partition by Deptno order by ename) from Emp Ord
Er by deptno;
DEPTNO ename SAL LAG (ename,
---------- ---------- ---------- ----------
Ten CLARK 2450
KING 5000 CLARK
MILLER 1300 KING
ADAMS 1100
FORD 3000 ADAMS
JONES 2975 FORD
SCOTT 3000 JONES.
SMITH SCOTT
ALLEN 1600
BLAKE 2850 ALLEN
JAMES
Oracle in the database, null values are used to indicate a situation where the actual value is unknown or meaningless. In a table, if a column in a row has no value, it is called a null value (NULL). Columns of any data type can have null values if they do not use non-null (not NULL) or primary key (PRIMARY key) integrity restrictions. In practical application, if the existence of NULL value is ignored, it will cause unnecessary trouble.
----For example, in the following employee table (EMP), th
Use the Linesize command to set the number of characters a row of data can hold, with a default number of 80. If the value of the linesize is smaller,Then a row of data in the table will need to be displayed on the screen, and if the value of Linesize is set larger, a row of data can beDisplayed in a row on the screen.The syntax of the Linesize command is as follows:Set Linesize nwhere n means that a row of data on the screen can beThe number of characters in Na, valid range is 1-32767.As shown
Rowid:object ID (6), relative file ID (3), block ID (6), row ID (3)
(1) Comparing the rowid of common table and cluster table
Sql> select Rowid,ename,sal from Scott.emp;
ROWID ename SAL
------------------ ---------- ----------
AAACYNAAEAAAAAEAAA SMITH 800
Aaacynaaeaaaaaeaab ALLEN 1600
AAACYNAAEAAAAAEAAC WARD 1250
Aaacynaaeaaaaaeaad JONES 2975
AAACYNAAEAAAAAEAAE MARTIN 1250
AAACYNAAEAAAAAEAAF BLAK
same name when you flash back to the table, you can specify a new table name on flashback:Sql> Flashback table EMP to before drop rename to Emp1;Flashback complete.2. misoperation Delete the EMP table
Use the Flashback query results to recover as long as the undo table space is still in error before the operation time data.sql> Delete from EMP;Rows deleted.Sql> commit;Commit complete.Sql> select * from EMP;No rows selectedSql> SELECT * from emp as of timestamp to_timestamp (' 2015-03-13 1
, the following query: SELECT * from EMP E, dept d WHERE E.deptno=d.deptno; EMPNO ename JOB MGR hiredate SAL COMM DEPTNO DEPTNO dname LOC---------- ---------- --------- ---------- -------------- ---------- ---------- ---------- ---------7782 CLARK MANAGER 7839 September-June -81 2450 ACCOUNTING NEW YORK7839 KING President 1 July-November -81 ACCOUNTING NEW YORK7934 MILLER Clerk 7782 2 March-January -82 1300 ACCOUNTING NEW YORK7369 SMITH Clerk 7902 1 July-December -80 the DALLAS7876 ADAMS Clerk
$
$999
Returns a dollar sign at the beginning of a number
Eeee
9.99EEEE
Scientific notation means
L
L999
Add a local currency symbol to the number before
PR
999PR
If a numeric negative number is represented by angle brackets
Code Demo: To_char Processing of numbersSelect To_char ( -123123.45, ' L9.9eeeepr ') "date" from dual;2, To_date (X,[,FMT])Converts a string into a date type in the FMT
Tags: oracle use pagesize commandwith the pagesize command, you can set the size of each page to control the amount of data displayed on each page. Syntax format of the pagesize commandAs follows:Set pagesize nWhere the parameter n represents a positive integer for each page size, the maximum value can be 50000, the default value is 14, the page is not just the output dataComposition, 20 by sql*plus like is to the screen of all output results constitute, including the title and Blank lines.For e
() function, handling nullExample: asking for a full annual salary for each employeeSELECT Ename,sal,comm, (sal+comm) *12 from EMP;Sql> SELECT Ename,sal,comm, (sal+comm) *12 from EMP; ename SAL COMM (sal+comm) *12-------------------------------------------SMITH 800ALLEN 22800WARD 1250 21000JONES 2975MARTIN 1250 1400
() over (partition by deptno order by sal) from emp order by deptno;
DEPTNO DENSE_RANK () OVER (PARTITIONBYDEPTNOORDERBYSAL)
-------------------------------------------------------
10 1
2
3
20 1
2
3
4
4
30 1
2
2
3
4
5
14 rows have been selected.
Used time: 00: 00: 00.20
SQL> select deptno, ename, sal, lag (ename, 1, null) over (partition by deptno order by ename) from emp ord
Er by deptno;
Deptno ename sal lag (ENAME,
----------------------------------------
10 CLARK 2450
KING 5000 CLARK
Example of using the over function in Oracle
Sum (sal) over (partition by deptno order by ename) Department continuous sum, -- the salary of each department "continuous" sum,
Environment: windows 2000 server + Oracle8.1.7 + SQL * plus
Objective: To use the scott model provided by oracle as the testing environment and analyze the usage of functions through testing.
Usage similar to sum (...) over...
1. Original table information:
SQL> break on deptno skip 1 -- display the data segments of differe
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.