Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I use ROWNUM attribute?

Status
Not open for further replies.

Cantor

Programmer
Apr 27, 2000
28
CA
Hi, I think I wounder about nothing but how do I must use the <b>ROWNUM</b> attribute? I must list only the first two elements of a table and I must use <b>ROWNUM</b> but I found nothing on that.<br><br><u>Thanx!!</u>
 
Cantor,<br><br>The rownum attribute can be selected as you would select any column in a table; but it's the row number of the table generated by the select statement - not the physical row number from the database...<br><br>The usual use of rownum is to pick out just the first few rows from a query, like this<br><br><FONT FACE=monospace><b><br>Select *<br>&nbsp;&nbsp;&nbsp;&nbsp;From EMP<br>&nbsp;&nbsp;&nbsp;&nbsp;Where ROWNUM &lt;4;<br></font></b><br><br>That will pick out the first three rows from that query.<br> <p>Mike<br><a href=mailto:Mike_Lacey@Cargill.Com>Mike_Lacey@Cargill.Com</a><br><a href= Cargill's Corporate Web Site</a><br>Please don't send me email questions without posting them as well. Post the question and send me a note saying "Have a look at so-and-so would you?" - that's fine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top