| lucky |
Posted: Jun 18, 2008 07:16:29 AM |
Total Post: 2
Joined: Jan, 2008
|
Hi all,
I want to know the querry for finding the number of column in a table.(not the number of rows)
|
|
|
shake |
| Posted: Jun 18, 2008 08:12:36 AM | |
|
Total Post: 84
Joined: Jun, 2008
|
SELECT COUNT(COLUMN_NAME) "No. Of Columns"
FROM DBA_TAB_COLUMNS WHERE TABLE_NAME = 'EMP'
AND OWNER='SCOTT';
EMP -> table_name in CAPITALS
SCOTT -> username in CAPITALS
If you enter the table and owner(user)name not in CAPS, wrong result will be produced.
|
|
|
|
|
lucky |
| Posted: Jun 18, 2008 09:24:02 AM | |
|
Total Post: 2
Joined: Jan, 2008
|
|
|
|
|
major |
| Posted: Jul 08, 2008 03:20:41 AM | |
|
Total Post: 14
Joined: Apr, 2008
|
for counting the number of columns use this
select count(*) from user_tab_columns where
table_name='file in the table name all in caps'
|
|
|
|
|
| Time Zone: EDT |
Send this thread to your friend |