Home » SQL & PL/SQL » SQL & PL/SQL » Oracle
Oracle [message #322544] Sat, 24 May 2008 05:33 Go to next message
panyam
Messages: 146
Registered: May 2008
Senior Member
Hi,

Can Any Body let me knw hw can i count the no.of columns in a table ???....
Re: Oracle [message #322545 is a reply to message #322544] Sat, 24 May 2008 05:50 Go to previous messageGo to next message
panyam
Messages: 146
Registered: May 2008
Senior Member

Hey ,

I got The Solution .

Below is the query which throws the total column count.

SELECT MAX(COLUMN_ID)
FROM user_tab_columns
WHERE table_name = <TABLE_NAME>
Re: Oracle [message #322562 is a reply to message #322544] Sat, 24 May 2008 08:58 Go to previous messageGo to next message
Michel Cadot
Messages: 68722
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Hopefully you named your topic "Oracle" otherwise we could think it is a MS/ACCESS question.
Oh wait... this is Oracle FAQ site... would be great if everyone give "Oracle" as title then we would be sure they don't post another kind of question.

Regards
Michel
Re: Oracle [message #322821 is a reply to message #322562] Mon, 26 May 2008 05:48 Go to previous messageGo to next message
panyam
Messages: 146
Registered: May 2008
Senior Member

hey ,..

sorry michale ,..i was in hurry so i put the title like 'that',....
Re: Oracle [message #322825 is a reply to message #322821] Mon, 26 May 2008 05:59 Go to previous messageGo to next message
Michel Cadot
Messages: 68722
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Hurry? Do you think we will answer in a minute?
What about just the last part of your question?
Of course using complete words and not IM/SMS speak.

Regards
Michel
Re: Oracle [message #322854 is a reply to message #322825] Mon, 26 May 2008 07:41 Go to previous messageGo to next message
panyam
Messages: 146
Registered: May 2008
Senior Member

However I got Solution for my question.

My Question is How can i Count No of Rows in a table ?.

I dont want to count manually by giving DESC <TABLE_NAME>.
Re: Oracle [message #322857 is a reply to message #322854] Mon, 26 May 2008 07:51 Go to previous messageGo to next message
S.Rajaram
Messages: 1027
Registered: October 2006
Location: United Kingdom
Senior Member
Quote:

My Question is How can i Count No of Rows in a table ?.

I dont want to count manually by giving DESC <TABLE_NAME>.

What do you mean by You do not want to count manually by giving desc <table_name>. What do you want to count ? Do you want count the number of columns in a given table or do you want the count the number of rows in the given table. Either way you have to use the same function, but the source will vary depends on what you want to count ? For how to count the number of rows/columns read the oracle sql reference manual and search for the keyword count.

Regards

Raj
Re: Oracle [message #322858 is a reply to message #322854] Mon, 26 May 2008 07:51 Go to previous messageGo to next message
Michel Cadot
Messages: 68722
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Quote:
However I got Solution for my question

Yes and I pointed to it in another topic for the same question.

Regards
Michel
Re: Oracle [message #322861 is a reply to message #322857] Mon, 26 May 2008 08:01 Go to previous messageGo to next message
panyam
Messages: 146
Registered: May 2008
Senior Member

Sorry Rajaram,.

It's not Rows ,it's columns that i want to count.
Re: Oracle [message #322989 is a reply to message #322545] Tue, 27 May 2008 00:23 Go to previous message
srini_thiru
Messages: 133
Registered: May 2008
Senior Member


You can also use this query too to find the Number of Columns in a table.

select count(*) from user_tab_columns where table_name='TABLENAME';


Cheers,
Seenu
Previous Topic: Trying to return 1 column but with multiple alias's
Next Topic: Hash partitions
Goto Forum:
  


Current Time: Mon Dec 09 20:25:41 CST 2024