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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SELECT statement with a maximum of rows, or the first or the last.

Status
Not open for further replies.

YipYeppp

Programmer
Nov 7, 2002
21
0
0
CA
Hi !!

Sure it is a really easy question.. but i've been searching a lot to find nothing.
I want to know how to make a SELECT statement and specify the maximum number of rows i want to have in the result. Also need to know how to specify that i want only the first or the last one of the table..
Thanks a looooooot !!
 
This is one of those questions whose answer will depend on the RDBMS you are using.
If you are using Oracle, you would use
WHERE rownum <= 100
to get the first 100 rows.
 
Hey.. thanks a lot !!

YipYeppppppppp is a happy girl now!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top