查找数据库中某表的字段名和字段类型

mysql:

1. 查找数据库中的所有表:show tables;

2. 查找表中的字段名和字段类型: show columns from table_name(表名);

                                                        show full columns from table_name;

oracle:

3. 查找User中所有的表名:select * from all_tables where owner='username'(用户名);

4. 查找表中的字段名和字段类型:

select u.COLUMN_NAME,u.DATA_TYPE  from user_tab_columns u
where TABLE_NAME='table_name'(表名);

猜你喜欢

转载自blog.csdn.net/weixin_42740268/article/details/81120499