Home » SQL & PL/SQL » SQL & PL/SQL » Simple Sql Query...
Simple Sql Query... [message #1354] Wed, 24 April 2002 03:04 Go to next message
karunamoorthy_p
Messages: 13
Registered: April 2002
Junior Member
Could you please help me to get the following query:

I want to get the table names(from scott user) and the corresponding number of rows using simple select query.
Re: Simple Sql Query... [message #1355 is a reply to message #1354] Wed, 24 April 2002 03:53 Go to previous messageGo to next message
Amit
Messages: 166
Registered: February 1999
Senior Member
Try This
select num_rows, lpad(table_name,15) from user_tables
Re: Simple Sql Query... [message #1360 is a reply to message #1354] Wed, 24 April 2002 07:05 Go to previous messageGo to next message
Epe
Messages: 99
Registered: March 2002
Member
Correct, if you are connected as SCOTT. Otherwise you need dba-rights to use the "dba_tables" or "all_tables" view (instead of the view "user_tables"), with the following where-clause : "where owner = 'SCOTT'".

Success,

epe
Re: Simple Sql Query... [message #1363 is a reply to message #1354] Wed, 24 April 2002 07:31 Go to previous message
Grant
Messages: 578
Registered: January 2002
Senior Member
select table_name from user_tables;
select count(*) from TABLENAME;
Previous Topic: Trigger Information
Next Topic: How to get even rows!.
Goto Forum:
  


Current Time: Tue Apr 16 12:40:58 CDT 2024