如何使用SQL计算表中的列数? [英] How to count the number of columns in a table using SQL?
本文介绍了如何使用SQL计算表中的列数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用SQL计算表中的列数?
How to count the number of columns in a table using SQL?
我正在使用Oracle 11g
I am using Oracle 11g
请帮助. t.
推荐答案
select count(*)
from user_tab_columns
where table_name='MYTABLE' --use upper case
您可以使用小写功能代替大写. 前任: 从user_tab_columns中选择count(*),其中lower(table_name)='table_name';
Instead of uppercase you can use lower function. Ex: select count(*) from user_tab_columns where lower(table_name)='table_name';
这篇关于如何使用SQL计算表中的列数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文