Home » SQL & PL/SQL » SQL & PL/SQL » What is diffrence between rowid and rownum
What is diffrence between rowid and rownum [message #122883] Wed, 08 June 2005 22:32 Go to next message
deshle
Messages: 23
Registered: June 2005
Location: Bangalore
Junior Member
Hi,

What is differnce between rowid and rownum

Bye
Re: What is diffrence between rowid and rownum [message #122930 is a reply to message #122883] Thu, 09 June 2005 05:00 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
Would you PLEASE start reading the manuals and searching the board.

Have you read the sticky yet? If not: do so. Useful links and tips inside.

As for your question: The FAQ, read it: http://www.orafaq.com/glossary/faqglosr.htm

MHE
Re: What is diffrence between rowid and rownum [message #122957 is a reply to message #122883] Thu, 09 June 2005 06:15 Go to previous messageGo to next message
nabeelkhan
Messages: 73
Registered: May 2005
Location: Kuwait
Member

ROWID:

A globally unique identifier for a row in a database. It is created at the time the row is inserted into a table, and destroyed when it is removed from a table.'BBBBBBBB.RRRR.FFFF' where BBBBBBBB is the block number, RRRR is the slot(row) number, and FFFF is a file number.

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;

Re: What is diffrence between rowid and rownum [message #122973 is a reply to message #122883] Thu, 09 June 2005 07:15 Go to previous messageGo to next message
Frank
Messages: 7901
Registered: March 2000
Senior Member
And yet again he doesn't have to check the docs because someone answered his basic question.
Did you really think Maaher didn't answer this because he didn't know the answer ?
Re: What is diffrence between rowid and rownum [message #123002 is a reply to message #122973] Thu, 09 June 2005 09:40 Go to previous messageGo to next message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
One ends in 'id' and the other ends in 'num.'
Re: What is diffrence between rowid and rownum [message #123325 is a reply to message #122973] Sun, 12 June 2005 00:52 Go to previous messageGo to next message
nabeelkhan
Messages: 73
Registered: May 2005
Location: Kuwait
Member

Frank wrote on Thu, 09 June 2005 15:15

And yet again he doesn't have to check the docs because someone answered his basic question.
Did you really think Maaher didn't answer this because he didn't know the answer ?


No I didn't met that, but i belive that knowledge should be given freely and without pain, coz i know what it means when u are lookin for something and you dont get it... I was just providin him easy knowledge, and on the other hand i get ot learn that too.

But Im really sorry if it was something i shouldn't do!
Re: What is diffrence between rowid and rownum [message #123333 is a reply to message #122883] Sun, 12 June 2005 02:24 Go to previous message
Frank
Messages: 7901
Registered: March 2000
Senior Member
Please don't be offended. In general, it is much appreciated to share (or gain) knowledge by answering questions. That's what this board is all about.
Some people though aren't willing to do any effort at all to search for the right answer. A simple google for oracle rowid rownum gains 6500 hits, with the first one explaining it all.
As you can read in the sticky (top post of the list) people are encouraged to first try and find the answer themselves, before asking the question here. The OP obviously didn't do that.
That was what I was ranting about, nothing personal to you.
See my point?
Please keep answering questions, as I said it is much appreciated.

hth
Previous Topic: server
Next Topic: Rollup and cube (merged)
Goto Forum:
  


Current Time: Sat Aug 02 08:44:53 CDT 2025