MySQL中查询所有数据库名和表名
查询所有数据库
show databases;
查询指定数据库中所有表名
select table_name from information_schema.tables where table_schema='database_name' and table_type='base table';
查询指定表中的所有字段名
select column_name from information_schema.columns where table_schema='database_name' and table_name='table_name';
查询指定表中的所有字段名和字段类型
select column_name,data_type from information_schema.columns where table_schema='database_name' and table_name='table_name';
SQLServer中查询所有数据库名和表名
查询所有数据库
select * from sysdatabases;
查询当前数据库中所有表名
select * from sysobjects where xtype='U'; xtype='U':表示所有用户表,xtype='S':表示所有系统表。
查询指定表中的所有字段名
select name from syscolumns where id=Object_Id('table_name');
查询指定表中的所有字段名和字段类型
select sc.name,st.name from syscolumns sc,systypes st where sc.xtype=st.xtype and sc.id in(select id from sysobjects where xtype='U' and name='table_name');
Oracle中查询所有数据库名和表名
查询所有数据库
由于Oralce没有库名,只有表空间,所以Oracle没有提供数据库名称查询支持,只提供了表空间名称查询。
select * from v$tablespace;--查询表空间(需要一定权限)
查询当前数据库中所有表名
select * from user_tables;
查询指定表中的所有字段名
select column_name from user_tab_columns where table_name = 'table_name';--表名要全大写
查询指定表中的所有字段名和字段类型
select column_name, data_type from user_tab_columns where table_name = 'table_name';-
使用SQL语句查询MySQL,SQLServer,Oracle所有数据库名和表名,字段名的SQL语句,简单明了
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
暂无“使用SQL语句查询MySQL,SQLServer,Oracle所有数据库名和表名,字段名”评论...
更新动态
2024年04月29日
2024年04月29日
- 物华弥新迷踪盘第1关怎么过 迷踪盘第1关通关方法
- win7没密钥怎么永久激活,w7系统激活密钥一键激活方法
- 怎么安装电脑系统版本,怎么安装电脑的系统
- 苹果电脑wps安装字体,苹果电脑wps怎么设置字体
- 活力美少女!《摇曳露营△》各务原抚子&志摩凛手办
- 《哥斯拉大战金刚2》票房破9亿 观影人次达2100万!
- 全新IP!《寂静岭2:重制版》开发商正在开发两款新作
- FlorilegiumandAshleySolomon-Haydn-SymphoniesNos.6,7,8LeMatin,Lemidi,LeSoir[flac]
- [PTC5186211]花痴系列-柏辽兹-幻想交响曲,Op.14-小泽征尔-波士顿交响乐团iso
- 欧阳菲菲-爱的路上我和你[东尼机构TONYLP-71LP黑胶转录]1977WAV+CUE
- 玩家确认《剑星》实体版可玩未审核版本:需断网安装
- 用火力战胜恐惧!《Backrooms Break》现已正式上线
- 晨报|《庄园领主》销量破百万 塔科夫PVE正式版将免费
- 冯天石《飞叶穿林——冯天石竹笛演奏专辑》[320K/MP3][92.25MB]
- 冯天石《飞叶穿林——冯天石竹笛演奏专辑》[FLAC/分轨][208.98MB]