Job Seekers   Employers
dbapool: Authors | Submissions | Contact Us
   Forgot password? | Sign up
  Home   Discussion Forum   Articles   Interview Questions   FAQs   Scripts   Rewards   Analyzer   White Papers   Blog   Certification   Downloads   Tools
 

Topic: Database Administration >> query to retrieve only 100 rows out of 1000 rows in a table?

Disclaimer: The purpose of all dbapool forums including OCP and Other Oracle Certification forums is to help each other with specific issues but not to share dump and copyrighted exam content, materials or intellectual property. You may review the entire Oracle Certification Program Candidate Agreement online Here.



  


 Title: query to retrieve only 100 rows out of 1000 rows in a table?
 vikhardba  Posted: Feb 01, 2008 11:00:58 PM

 Total Post: 84
 Joined: Apr, 2007






 What is the query to retrieve only 100 rows out of 4000 rows in a table?

can you also tell me about select * from tablename sample(20);
where tablename contains around 50,000 rows.

 Mohammed Taj
Posted: Feb 01, 2008 11:54:42 PM  

 Total Post: 694
 Joined: Jul, 2007






 
you have to go through documentation for that.
http://tahiti.oracle.com

HINT: use where clause with select statement.



 vikhardba
Posted: Feb 02, 2008 02:12:51 AM  

 Total Post: 84
 Joined: Apr, 2007






 
By using where clause i can retrieve only 1 row. but i need userdefined rows.
For ex:- Out of 5000 rows, need 60 rows only. So, can anyone give me the query ASAP

 Vinod
Posted: Feb 02, 2008 07:49:52 AM  

 Total Post: 54
 Joined: Oct, 2007






 

SQL> select table_name,OWNER from dba_tables where rownum < 60;

TABLE_NAME OWNER
------------------------------ ------------------------------
ICOL$ SYS
CON$ SYS
UNDO$ SYS
PROXY_ROLE_DATA$ SYS
FILE$ SYS
UET$ SYS
IND$ SYS
SEG$ SYS
COL$ SYS
CLU$ SYS
.
.
.
SQL> select OWNER,TABLE_NAME from ALL_XML_TAB_COLS where rownum < 10;

OWNER TABLE_NAME
------------------------------ ------------------------------
XDB XDB$RESOURCE
MDSYS SDO_GR_MOSAIC_0
MDSYS SDO_COORD_OP_PARAM_VALS
.
.
If you are interested in any other user defined format ,you may have to make use of WHERE clause with AND


 vikhardba
Posted: Feb 04, 2008 03:29:19 AM  

 Total Post: 84
 Joined: Apr, 2007






 
Thanks a bunch!!!

 Time Zone: EDT

  




Forum Rules & Description


Who Can Read The Forum? Any registered user or guest
Who Can Post New Topics? Any registered user
Who Can Post Replies? Any registered user




 








Get FREE Magazines

Top 10 Forum User

  Murtuja Khokhar814
  Mohammed Taj694
  Jayanta Sur479
  Vigyan Kaushik386
  positive fanatic361
  Gitesh Trivedi322
  Gopu Gopi239
  neeraj sharma228
  Ramesh Jois226
  snehalatha p169






oracle Mag



  About Us Advertise Terms of Use Privacy Newsletters Contact Us    

Home   Discussion Forum   FAQs  Articles  Jobs   Newsletters  Directory  Downloads 

Our Premium Sponsor
Confio Software