日期:2014-05-17  浏览次数:21139 次

在oracle中如何查询一个表中有多少个字段
如何在表比如student中查询含有多少个字段(属性)

------解决方案--------------------
select a.tname,count(*) field_count from tab a,user_col_comments b where tabtype= 'TABLE ' and a.tname=b.table_name group by a.tname
------解决方案--------------------
返回表中的字段数目。
语法

FCOUNT([nWorkArea | cTableAlias])

参数

nWorkArea

指定一个表所在的工作区,FCOUNT( ) 函数返回该表的字段数目。
如果在指定工作区没有打开的表,则 FCOUNT( ) 函数返回 0。

cTableAlias

指定表的别名,FCOUNT( ) 函数返回该表的字段数目。
如果所指定的表别名不存在,Visual FoxPro 将产生错误信息。

返回值类型
数值型
说明
如果省略可选的参数,FCOUNT( ) 函数将返回当前选定工作区中已打开表的字段数目。
------解决方案--------------------
用这个也可以 desc student
------解决方案--------------------
select count(column_name) from user_col_comments where table_name= 'student '
这是根据一楼给的 "user_col_comments "表写的
------解决方案--------------------
select count(column_name) from all_col_comments where table_name= 'Works ';
------解决方案--------------------
select count(1)
from user_col_comments
where table_name = upper( 'student ');