0

Hi,

I want to know , how to retrive the table name from multiple tables from a database which having the maximum number of rows....

As i am new to oracle can anybody help me as fast as possible...


Thanks

Ashish

2
Contributors
5
Replies
6
Views
6 Years
Discussion Span
Last Post by urtrivedi
0

Thanks for reply , but can u plz explain wht is wht in this query so that it better to write ....
Please

1
SELECT TABLE_NAME, NUM_ROWS FROM all_tables WHERE owner='SCHEMANAME' ORDER BY num_rows DESC

1) ALL_TABLES is oracle system table
2) If your username IN oracle AAKASH, then here owner or shchem is aaksas in CAPITAL letters, it will show only tables belong to AAKASH oracle user.
3) there are so many properties of table, you may use * in query. NUM_ROWS is no of records in that table. And I have ordered it in descending manner by number of records
4) So when u see query result, you will find table with most no of rows, at the top.

Votes + Comments
great explaination
0

Thanks

Sorry i want just one more thing ...
I need ,all the datas from the table(one table) having more number of rows from multiple tables within a database.

0

It can not be done through pure sql, I guess you want show content of table which is having max number of rows in database. So here your table name is not know to query.

What is your front end. If you can build query dynamically. Then you have to execute two queries one by one.

FIrst one I given you in above post, NOw the top most rows TABLE_NAME is your required table name

Now you can build another query

select * from 'tablename'

I am not sure I am able to explain or not.

Edited by urtrivedi: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.