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

Hello, I need to grad the first

Status
Not open for further replies.

wuwang

Programmer
May 16, 2001
48
US
Hello,

I need to grad the first 50 records from a table
base on primary key.
Is there any function in SQL or SQL*Plus doing this?

Thanks you for your help.

Jimmy
 
SELECT *
FROM (SELECT * FROM my_table ORDER BY your_primary_key_column ASC)
WHERE rownum < 51;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top