# of non-reference tables
Posted in 2008
Topics: General Discussion
Can anyone provide a query for finding number of non-reference tables(i.e table may or may not have primary key but definetly it should not have a foriegn key ( i.e it should not refer to other tables) ) Thanks, Shan
This should do it: SELECT t.tabid,t.tabname FROM systables t WHERE NOT EXISTS ( SELECT c.tabid FROM sysconstraints c WHERE c.tabid = t.tabid and c.constrtype = 'R') AND t.tabid >= 100 Please check! Regards. On Mon, Sep 15, 2008 at 11:50 AM, SHANOOF BASHEER <sbasheer@csc.com> wrote: > Can anyone provide a query for finding number of non-reference tables(i.e > table may or may not have primary key but definetly it should not have a > foriegn key ( i.e it should not refer to other tables) ) > > Thanks, > Shan > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > -- -- Fernando Nunes Portugal http://informix-technology.blogspot.com My email works... but I don't check it frequently...