select count(column_n
ame)
From user_tab_columns where table_name='T_B_AUD
ITOR'
mysql> desc
test;
+---------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------+-------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| name | v
Archar(10) | YES | | NULL | |
| address |
VARchar(30) | YES | | NULL | |
+---------+-------------+------+-----+---------+----------------+
3 rows in set (0.01 sec)
mysql> select found_rows();
+--------------+
| found_rows() |
+--------------+
| 3 |
+--------------+
1 row in set (0.01 sec)
mysql> select table_schema,count(*) from tables
group by table_schema;
+--------------------+----------+
| table_schema | count(*) |
+--------------------+----------+
| information_schema | 17 |
| mysql | 17 |
| test | 6 |
+--------------------+----------+
3 rows in set (0.00 sec)
其实在系统表information_schema中大多的数据库,表啊都会有记录的。所以要好好研究下这张表呢。