代码之家  ›  专栏  ›  技术社区  ›  Avinash

how to count number of tables/views/index in my database

  •  2
  • Avinash  · 技术社区  · 16 年前

    how to count number of tables/views/index in my database

    I am using sybase 11

    3 回复  |  直到 12 年前
        1
  •  10
  •   Pat Wallace    16 年前
    select count(*) from sysobjects where type = 'U'
    

    should get you the number of user tables. You can also use type = 'V' 数数。

    select count(*) from sysindexes 
    

    will give you an index count. You may need to further filter both though, depending on which types of indexes you want.

    sysobjects reference here .
    sysindexes reference 在这里 .

        2
  •  0
  •   Md. Naushad Alam    12 年前

    甲骨文

    计数表:

    SELECT COUNT(*) FROM user_tables;

    计数序列

    从用户序列中选择count(*)。

    计数视图

    SELECT COUNT(*) FROM user_views;

    计数指标

    SELECT COUNT(*) FROM user_indexes;

        3
  •  -1
  •   Luke Hardik Soni    14 年前

    希望下面的SQL作品

    SELECT COUNT(*) FROM USER_TABLES;
    

    将返回各自数据库中的表数。

    推荐文章