当前位置:网站首页>将某数据库N多表名作为另外一张表中某一列得值(范围可以是别的数据库中得某张表)
将某数据库N多表名作为另外一张表中某一列得值(范围可以是别的数据库中得某张表)
2022-06-27 23:47:00 【OUO~】
需求场景

先查查能否匹配上
select * from ouo o
INNER JOIN information_schema.TABLES t on INSTR(t.table_name,o.key)
where table_schema='wewe'

发现能匹配上,下一步就可以批量修改了
update ouo o INNER JOIN information_schema.TABLES t on INSTR(t.table_name,o.key)
set o.username=t.table_name
where table_schema='wewe'
结果如下图

主要是MYSQL INSTR函数得作用,可以搜搜MYSQL 字符串包含尝试更多种写法
边栏推荐
- 免费、好用、强大的开源笔记软件综合评测
- What is a through-hole conductive slip ring?
- Adobe Premiere Basics - common video effects (corner positioning, mosaic, blur, sharpen, handwriting tools, effect control hierarchy) (16)
- LMSOC:一种对社会敏感的预训练方法
- Set collection usage
- 数据库的新选择 Amazon Aurora
- TIA botu_ Concrete method of making analog input and output Global Library Based on SCL language
- [embedded foundation] memory (cache, ram, ROM, flash)
- TI AM3352/54/59 工业核心板硬件说明书
- I/O限制进程与CPU限制进程
猜你喜欢

面试官问:能否模拟实现JS的new操作符

Web3 技术初体验以及相关学习资料

Web3 technology initial experience and related learning materials

药物发现综述-01-药物发现概述

【嵌入式基础】串口通信

Data analysts too hot? Monthly income 3W? Tell you the true situation of this industry with data
![The number of nodes of a complete binary tree [non-O (n) solution > Abstract dichotomy]](/img/56/768f8be9f70bf751f176e40cbb1df2.png)
The number of nodes of a complete binary tree [non-O (n) solution > Abstract dichotomy]

Drug interaction prediction based on learning size adaptive molecular substructure

9. Openfeign service interface call

SQL Server 2016 detailed installation tutorial (with registration code and resources)
随机推荐
Arrays. Aslist() pit
205. 同构字符串
Adobe Premiere foundation - sound adjustment (volume correction, noise reduction, telephone tone, pitch shifter, parameter equalizer) (XVIII)
Evaluation - grey correlation analysis
PostgreSQL setting auto increment field
Centos8 operation record command version Yum redis MySQL Nacos JDK
Is there any risk in opening an account for flush stock? Is it safe for flush to open an account
Intensive reading of transformer thesis paragraph by paragraph
awk注意的几个问题
Meituan dynamic thread pool practice idea has been open source
Chapitre 4: redis
Database query optimization: master-slave read-write separation and common problems
Is it safe to open an account online now? Novice is just on the road, ask for the answer
面试官问:JS的继承
Official announcement! Apache Doris graduated from the Apache incubator and officially became the top project of Apache!
有监督、无监督与半监督学习
TD Hero 线上发布会|7月2日邀你来
Drug interaction prediction based on learning size adaptive molecular substructure
[embedded foundation] memory (cache, ram, ROM, flash)
数据库查询优化:主从读写分离及常见问题