GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Oracle  >  SQL
Go To First  |  Previous Question  |  Next Question 
 SQL  |  Question 76 of 171    Print  
What is the difference between ROWNUM and ROWID

  
Total Answers and Comments: 6 Last Update: February 26, 2008     Asked by: kamaldass 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
March 04, 2006 05:47:23   #1  
rameshnaidu        

RE: what is the difference between ROWNUM and ROWID
the ROWNUM is a number(like serial no) which is dynamically changes.but the ROWID does not change.Because it is having the unique address which is generated by the oracle
 
Is this answer useful? Yes | No
March 25, 2006 04:38:29   #2  
dwhprofessional Member Since: March 2006   Contribution: 6    

RE: what is the difference between ROWNUM and ROWID

rownum is a pseudo column. It numbers the records in a result set. The first record that meets the where criteria in a select statement is given rownum 1 and every subsequent record meeting that same criteria increases rownum.

A rowid is a pseudo column (like versions_xid) that uniquely identifies a row within a table but not within a database. It is possible for two rows of two different tables stored in the same cluster to have the same rowid.


 
Is this answer useful? Yes | No
May 17, 2006 10:44:27   #3  
nileshsingh Member Since: May 2006   Contribution: 12    

RE: what is the difference between ROWNUM and ROWID
rowid is a hexadecimal representation and
rownum is normal representation of rows uniquely.
SQL> select rowid rownum i from t1;
ROWID ROWNUM I
--------------------------------------------- -------------- ----------
AAAM6MAABAAAO8qAAA 1 1
AAAM6MAABAAAO8qAAB 2 2
AAAM6MAABAAAO8qAAC 3 3
AAAM6MAABAAAO8qAAD 4 4
AAAM6MAABAAAO8qAAE 5 5
SQL> select rowid rownum i from t1 where i in (1 2 4 5);
ROWID ROWNUM I
--------------------------------------------- -------------- ----------
AAAM6MAABAAAO8qAAA 1 1
AAAM6MAABAAAO8qAAB 2 2
AAAM6MAABAAAO8qAAD 3 4
AAAM6MAABAAAO8qAAE 4 5

 
Is this answer useful? Yes | No
September 02, 2007 07:28:05   #4  
roniprasan Member Since: September 2007   Contribution: 3    

RE: what is the difference between ROWNUM and ROWID
Rowid is a psudo column and system generated id to a row which is a alphanumaric value. It contains 16 charecters. Rownum is a psudo column which is a sequential order of numbers given to the rows.
 
Is this answer useful? Yes | No
February 06, 2008 23:16:33   #5  
g_sidhu Member Since: August 2007   Contribution: 122    

RE: What is the difference between ROWNUM and ROWID

Rowid: Hexadecimal string representing the unique address of a row in its table. This datatype is primarily for values returned by the ROWID pseudocolumn.

Rownum: For each row returned by a query the ROWNUM pseudocolumn returns a number indicating the order in which Oracle selects the row from a table or set of joined rows. The first row selected has a ROWNUM of 1 the second has 2 and so on. You can use ROWNUM to limit the number of rows returned by a query as in this example:

SELECT * FROM employees WHERE ROWNUM < 10;


 
Is this answer useful? Yes | No
February 26, 2008 05:43:01   #6  
sampra Member Since: February 2008   Contribution: 278    

RE: What is the difference between ROWNUM and ROWID

the ROWNUM is a number(like serial no) which is dynamically changes.but the ROWID does not change.Because it is having the unique address which is generated by the oracle

 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape