Oracle中查询一个表中的所有列名,然后将列名,把不同数据类型的分类在一起。
ORACLE:
select column_name,data_type from user_tab_columns where table_name = 'SZKB' order by data_type
SELECT COLUMN_NAME ,data_type FROM USER_TAB_COLS WHERE TABLE_NAME = 'SZKB' order by data_type
select column_name from user_tab_columns where table_name = 'HLGA' order by data_type
SQL2005:
select name from syscolumns where id=object_id('表名')
select count(*) from syscolumns where id=object_id('表名')
MY-SQL数据库里可以用:
show columns from tablename
show database;
show tables from database;