sql 查询表共多少列

1、oracle:

select count(*) from user_tab_cols where table_name='表名';--表名含英文的话应为英文大写字母

2、mysql:

select count(*) from information_schema.COLUMNS where table_name='表名';--表名大小写均可

3、sqlserver:

select count(*) from syscolumns s  where s.id = object_id('test');--表名大小写均可

原文地址:https://www.cnblogs.com/itdaocaoren/p/5864764.html