Home » SQL & PL/SQL » SQL & PL/SQL » how to count columns in table
how to count columns in table [message #217861] Mon, 05 February 2007 21:59 Go to next message
chandrakanth.infosage
Messages: 2
Registered: February 2007
Junior Member
hi.i want to know how to count columns in a table;
ex:emp table has 10 columns and 10 rows
by using count(*) from emp we know the rows of the table;
how to know count of the columns?
Re: how to count columns in table [message #217866 is a reply to message #217861] Mon, 05 February 2007 22:41 Go to previous messageGo to next message
rleishman
Messages: 3724
Registered: October 2005
Location: Melbourne, Australia
Senior Member
Take a look at USER_TAB_COLUMNS
Re: how to count columns in table [message #217868 is a reply to message #217866] Mon, 05 February 2007 22:44 Go to previous messageGo to next message
ishika_20
Messages: 339
Registered: December 2006
Location: delhi
Senior Member


select count(*) from user_tab_columns where table_name = 'table_name'
Re: how to count columns in table [message #217870 is a reply to message #217861] Mon, 05 February 2007 22:47 Go to previous message
Mohammad Taj
Messages: 2412
Registered: September 2006
Location: Dubai, UAE
Senior Member

hi,
select count(*) from user_tab_cols where table_name = '&table_name';


regards
Taj
Previous Topic: Doubt in MV refresh
Next Topic: %type variables
Goto Forum:
  


Current Time: Thu Dec 08 10:20:00 CST 2016

Total time taken to generate the page: 0.09023 seconds