mysql查询包含某字段的表_SQL数据库,如何查询数据库内含有某一列(某字段,如name)的所有表...

展开全部

SQL数据库,查询bai数据库内含有某一列du(某字段,zhi如name)的所有表dao的步骤如下:

我们需要准版备的材料分别是:电脑权、sql查询器。

1、首先,打开sql查询器,连接上相应的数据连接,,例如test库。

e92a899de7935855c50349664e631964.png

2、点击“查询”按钮,输入:select table_name from information_schema.columns where table_schema="test" and column_name="name";。

6cbd97939a023b828a092dd9c65e18fa.png

3、点击“运行”按钮,此时会查询出符合条件的表名。

aaf0d7f679d3eac9daa743c825b2e208.png

4、将查询语句调整为:select 'store' as table_name, `name` from store where `name`="A" union all select 'stu' as table_name, `name` from stu where `name`="A" union all select 'test' as table_name, `name` from test where `name`="A",点击“运行”按钮,即可查到含name='A'的表名。

c451b87930a5beba636277c3221342a9.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值