<<Previous Next>>
Oracle - Difference between
rowid and rownum - Feb 18, 2010 at 11:00 PM by Rajmeet
Ghai
Explain the difference between rowid and
rownum.
ROWID is a unique pseudo number assigned to a row. Rownum returns
the number of rows for a resultant query. BOTH are pseudo columns
not occupying any physical space in the database.
Example of Rownum: Sort salary and return first 5
rows. select * from ( select
* from
emp order by sal
desc ) where ROWNUM <= 5;
Example of Rowid: Below query selects address of all rows that
contain data for students in department 20 SELECT ROWID,
last_name FROM
student WHERE department_id
= 20;
Oracle -
Difference between rowid and rownum - April 10, 2009
at 11:00 AM
Explain the difference between rowid and
rownum.
RowId represents a row in a table
internally. It can be used for fast access to the row. Rownum is a
function of the result set. select * from Student where rownum = 2 will get
the first 2 rows of your result set.
Also read
A cluster contains data from one or more tables. All these tables
have one or more columns in common. All the rows from all the tables
that share the same cluster key...............
Explain the constraints that can be applied to Oracle tables,
Explain various types of constraints in Oracle, What is an integrity
constraint?.................
When a sequence is created using CYCLE option, values for the
column are regenerated from MINVALUE once MAXVALUE is
reached..........
Automatic Performance Diagnostic and Tuning Features, Automatic
Shared Memory Management - Automatic Shared Memory Management puts
Oracle in control of allocating memory within the SGA...........
|