查找表中的列数 [英] Find the number of columns in a table

查看:35
本文介绍了查找表中的列数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否可以找到表中的行数和列数.

I would like to know if it's possible to find the number of both rows and columns within a table.

SELECT COUNT(*)
FROM tablename

推荐答案

SELECT COUNT(*)
  FROM INFORMATION_SCHEMA.COLUMNS
 WHERE table_catalog = 'database_name' -- the database
   AND table_name = 'table_name'

这篇关于查找表中的列数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆