Home » SQL & PL/SQL » SQL & PL/SQL » about sql queries
about sql queries [message #326931] Fri, 13 June 2008 02:27 Go to next message
raj_roshan_009
Messages: 29
Registered: May 2008
Junior Member
Hi all,

i want to know the name of table in my database in which atleast 1 record is present.

what sql query i shoud have to write.

Please help me.
Thanks
Roshan.
Re: about sql queries [message #326949 is a reply to message #326931] Fri, 13 June 2008 02:59 Go to previous messageGo to next message
Michel Cadot
Messages: 64133
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Question Why is this in Backup & Recovery forum? Question

Search for "count rows in tables" or the like, this has been addressed many times.

Regards
Michel
Re: about sql queries [message #326956 is a reply to message #326931] Fri, 13 June 2008 03:26 Go to previous messageGo to next message
saikumar_mudigonda
Messages: 23
Registered: June 2008
Location: hyderabad
Junior Member
you can get using this, but before running pls do analyze to get upto date data (if analyze not happens regularly)

select owner,table_name,num_rows from dba_tables
where nvl(num_rows,0)>=1

[Updated on: Fri, 13 June 2008 03:26]

Report message to a moderator

Re: about sql queries [message #326958 is a reply to message #326956] Fri, 13 June 2008 03:50 Go to previous messageGo to next message
raj_roshan_009
Messages: 29
Registered: May 2008
Junior Member
Thanks saikumar.
Re: about sql queries [message #326959 is a reply to message #326949] Fri, 13 June 2008 03:56 Go to previous messageGo to next message
raj_roshan_009
Messages: 29
Registered: May 2008
Junior Member
sorry,
i was very confused on that time.

Regards
Roshan.
Re: about sql queries [message #326960 is a reply to message #326956] Fri, 13 June 2008 03:57 Go to previous message
Michel Cadot
Messages: 64133
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
saikumar_mudigonda wrote on Fri, 13 June 2008 10:26
you can get using this, but before running pls do analyze to get upto date data (if analyze not happens regularly)

select owner,table_name,num_rows from dba_tables
where nvl(num_rows,0)>=1


If table is analyze then num_rows can't be null.
If it is null then result is incorrect.

In addition, it is useless as "num_rows>=1" will return the same thing.

Regards
Michel
Previous Topic: an interesting sql query with difficult o/p
Next Topic: Query
Goto Forum:
  


Current Time: Thu Dec 08 04:14:48 CST 2016

Total time taken to generate the page: 0.11908 seconds