日期:2014-05-16 浏览次数:20332 次
1、MSSQL Server
表:select COUNT(*) from dbo.sysobjects WHERE name= 'table_name';2、My SQL
表:select COUNT(*) from information_schema.tables WHERE table_name = 'table_name';3、Oracle
表:SELECT count(*) FROM USER_OBJECTS WHERE OBJECT_NAME = 'table_name';4、PostgreSql
表:select count(*) from information_schema.tables WHERE table_schema='table_schema' and table_name ='table_name';字段:select count(*) from information_schema.columns WHERE table_schema='table_schema' and table_name ='table_name' and column_name='column_name';