Pseudo- column: a pseudo-column in Oracle is like a table column (a column in a table), but it is not stored in a table, a pseudo-column can be queried from a table, but its values cannot be inserted, updated, or deleted
Common pseudo-Columns are ROWID and rownum.
use of ROWID--quickly delete duplicate records
Parse: ROWID is the detailed address of the data, through ROWID,Oracle can quickly locate the location of the specific data of a row.
ROWID can be divided into two kinds of physical ROWID and logic ROWID .
in a normal table. rowID is a physical rowID , index Organization table (IOT) of the rowID is logical rowID .
When there is a large amount of duplicate data in the table, you can use ROWID quickly delete duplicate records.
Query statement:
Select Rowid,rownum from Student
ROWNUM
ROWNUM is the ordinal of the row in the result set returned by the query, which you can use to limit the number of rows returned by the query
through testing, Rownum can only filter =1 and <n , if >m cannot filter, how to evade.
construct a temporary table from a subquery so that the pseudo-column Rownun is called a column in a staging table, and then a qualified condition uses a pseudo-column
Alias.
Using pseudo-Columns to query for data with pseudo-column numbers equal to 2
Select *from
(
Select Id,name,rownum rn from student
) Temp
where RN =2
Querying 第4-6条 data with pseudo-columns
Select *from
(
Select Temp.*,rownum rn from
(
Select *from Student
) Temp
where rownum<=6
) Where rn>=4
Pseudo-Columns for Oracle databases