RE: sql help

RE: sql help

 

  

This should work.

SELECT 'Select ''' || table_name || ''', count(*) from ' || table_name
|| ' ;' FROM USER_TABLES WHERE table_name LIKE 'GL%';


Murali.



-----Original Message-----
From: bralston
[mailto:oracledba-ezmlmshield-x79985453.[Email address protected]
Sent: Tuesday, May 31, 2005 3:34 PM
To: LazyDBA Discussion
Subject: sql help

I have what is probably a basic sql question. I am pulling a list of
tables
that have a name like 'GL%'. I am then wanting to pull a count on each
table
in the same clause to get output like this :

Table_name Count

GLMASTER 100
GLNAME 94
GLTRANS 500


Any ideas ???

Brad

This e-mail contains information that may be proprietary in nature or
otherwise protected by law from disclosure, and is intended only for the
addressee(s) named above. If you are not the addresee, or the person
responsible for delivering this to the addressee(s), you are hereby
notified that reading, copying or distributing this e-mail is
prohibited.

If you have received this e-mail in error, please contact the sender of
this e-mail immediately.




--------
website: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com
To unsubscribe: see http://www.lazydba.com/unsubscribe.html
To subscribe: see http://www.lazydba.com
By using this list you agree to these
terms:http://www.lazydba.com/legal.html

Oracle LazyDBA home page