| 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
|
|
|
|
|
| Time Zone: EDT |
Send this thread to your friend |