mysql根据一个表更新另外一个表
2024-09-03 22:26:43
-- 语法:update table_1 t1,table_2 t2 set t1.column = t2.column where t1.id = t2.pid; UPDATE house_test.shareInfo AS t1,
(
SELECT
u.*,
g.city_code
FROM
`api`.`user` AS u
LEFT JOIN `api`.`group` AS g ON g.group_id = u.group_id
) AS t2
SET t1.cityCode = t2.city_code
WHERE
t1.userId = t2.user_id
AND (
t1.cityCode IS NULL
OR t1.cityCode = '')
最新文章
- python学习笔记之装饰器、递归、算法(第四天)
- 查询oracle数据库中的所有表空间信息
- 在linux下python爬虫进程发生异常时自动重启直至正常结束的方法
- POJ - 1159 Palindrome(dp-回文变形)
- map使用.xml
- Python编程中的反模式
- C#几个经常犯错误汇总
- 嘟!数字三角形 W WW WWW集合!
- 配置keil MDK和keil C51共存
- 齐博软件(地方门户系统) ;文件加密破解工具
- C# using
- data.table包简介
- MySql开启慢查询日志并使用pt-query-digest 分析
- 解决Requests中文乱码【有用】,读取htm文件 读取txt文件报错:UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc8 in position 0
- 理解Hash
- 【php】---mysql语法增、删、改、查---【巷子】
- Apache commons StringUtils 在运行时出现NoClassDefError错误的解决方法
- poj 3133 Manhattan Wiring
- Springboot 拦截器(HandlerInterceptorAdapter)中注入无效
- Java学习之SpringBoot整合SSM Demo