愚者樹屋

|
Home About Contact
|

series

3d軟體 (1) apache (1) css (4) godot (8) google-api (1) google翻譯 (1) html (6) hugo安裝 (7) javasciprt (1) javascript (14) jquery (3) mysql (9) notepad++ (1) php (33) python (1) unity (1) yt-dlp (1) 像素畫 (1) 免費軟體 (8) 壓力測試 (2) 弱點掃描修補 (1) 無障礙網站 (1) 社群網站 (1) 遊戲推薦 (4) 雜記 (1)

Tags

2d軟體 3d軟體 ai apache css godot google-api google翻譯 html hugo javasciprt javascript jquery mysql notepad++ php python tcpdf unity vroid

mysql 用select更新資料

post date - 2023/07/01
last update - 2023/07/01

最近碰到了需要一次性將A表格的資料更新到B表格的狀況,順便記錄一下mysql的語法。

參考資料:https://stackoverflow.com/questions/1262786/mysql-update-query-based-on-select-query

使用select資料來更新需要更新的表格,如果a表格的欄位已經有資料的話就不更新。

UPDATE updatetable a
INNER JOIN selecttable b ON a.USER = b.USER
SET a.email = if(a.email = '', b.EMail, a.email)
WHERE a.Class='條件'
Tags : mysql

series

3d軟體 (1) apache (1) css (4) godot (8) google-api (1) google翻譯 (1) html (6) hugo安裝 (7) javasciprt (1) javascript (14) jquery (3) mysql (9) notepad++ (1) php (33) python (1) unity (1) yt-dlp (1) 像素畫 (1) 免費軟體 (8) 壓力測試 (2) 弱點掃描修補 (1) 無障礙網站 (1) 社群網站 (1) 遊戲推薦 (4) 雜記 (1)

Tags

2d軟體 3d軟體 ai apache css godot google-api google翻譯 html hugo javasciprt javascript jquery mysql notepad++ php python tcpdf unity vroid

Recent Posts

php 切出每個中文字

2024/09/28

網站爬蟲設定(robots.txt)

2022/10/08

mysql 時間計算

2024/09/14

孔明舞(チキチキバンバン)跳舞用法

2022/12/18

設定手機加到主畫面圖案

2023/12/30

mastodon misskey pixiv plurk twitter 巴哈姆特

© 2022-2025 愚者樹屋