Home » SQL & PL/SQL » SQL & PL/SQL » how can i count the columns in a table?
icon14.gif  how can i count the columns in a table? [message #198587] Tue, 17 October 2006 19:19 Go to next message
pvannapurna
Messages: 8
Registered: October 2006
Location: Hyderabad
Junior Member
is it possible to count no.of columns?

like row count.

eg : select count(*)
from table_name;

o/p : it gives the no.of.rows in a table, right.

then hw can i calculate column count?

Thanks n Regards
Annapurna

Re: how can i count the columns in a table? [message #198591 is a reply to message #198587] Tue, 17 October 2006 19:58 Go to previous messageGo to next message
BlackSwan
Messages: 25036
Registered: January 2009
Location: SoCal
Senior Member
user_tab_columns
Re: how can i count the columns in a table? [message #198631 is a reply to message #198587] Wed, 18 October 2006 01:11 Go to previous messageGo to next message
rkesavan
Messages: 6
Registered: October 2006
Junior Member
select count(column_name) from user_tab_columns
where table_name = 'EMP';
Re: how can i count the columns in a table? [message #198633 is a reply to message #198631] Wed, 18 October 2006 01:15 Go to previous messageGo to next message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
rkesavan wrote on Wed, 18 October 2006 08:11
select count(column_name) from user_tab_columns
where table_name = 'EMP';

And another "spoonfeed echo"...

Mr kesavan, you don't have to repost answers already posted by other users. We tend to make the members think a little bit for themselves Wink

MHE

Re: how can i count the columns in a table? [message #263274 is a reply to message #198631] Wed, 29 August 2007 10:15 Go to previous messageGo to next message
pvannapurna
Messages: 8
Registered: October 2006
Location: Hyderabad
Junior Member
Thanx a lot.
Re: how can i count the columns in a table? [message #263313 is a reply to message #263274] Wed, 29 August 2007 12:30 Go to previous message
joy_division
Messages: 4640
Registered: February 2005
Location: East Coast USA
Senior Member
Congratulations on waking up from your coma.
Previous Topic: Copying Large amounts of Data Effectively and Efficiently
Next Topic: what are all the steps to take snapshot in oracle 9i ?
Goto Forum:
  


Current Time: Sun Dec 04 15:01:58 CST 2016

Total time taken to generate the page: 0.04657 seconds