Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2007
    Posts
    49

    Unanswered: How to find tables with no rows in a database

    Hello all

    In a database how to know the list tables with 0 rows. ( Count(*) = 0)

    Can we achieve this in a single query

    Thank You
    Kalyani Ch

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Sure, if your runstats are current:

    Code:
    select tabschema,tabname from syscat.tables where card = 0
    Andy

  3. #3
    Join Date
    Nov 2005
    Location
    IL
    Posts
    557
    Yes, but only if stats were collected. Other wise I would write a shell loop to go after all tables.
    --
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows

    DB2 v9.7.0.6 os 6.1.0.0

  4. #4
    Join Date
    Dec 2007
    Posts
    49
    Thank You. It worked

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •